}
final int pos = originalMessage.position();
final SSLEngineResult sslEngineResult;
if (!originalMessage.isComposite()) {
sslEngineResult = sslEngine.unwrap(originalMessage.toByteBuffer(),
targetBuffer.toByteBuffer());
} else {
final ByteBuffer originalByteBuffer =
originalMessage.toByteBuffer(pos,
pos + expectedLength);