jweStream.flush();
} else {
CachedOutputStream cos = new CachedOutputStream();
ctx.setOutputStream(cos);
ctx.proceed();
String jweContent = theEncryptionProvider.encrypt(cos.getBytes(), ctString);
IOUtils.copy(new ByteArrayInputStream(jweContent.getBytes("UTF-8")), actualOs);
actualOs.flush();
}
}