if (protocolHandler.hasExtensions()) {
byte[] tempFrame;
byte[] byteArrayMessage = new byte[message.remaining()];
message.get(byteArrayMessage);
final Frame dataFrame = new BinaryFrame(byteArrayMessage, false, true);
final ByteBuffer byteBuffer = remoteEndpoint.getSocket().getProtocolHandler().frame(dataFrame);
tempFrame = new byte[byteBuffer.remaining()];
byteBuffer.get(tempFrame);
final Future<Frame> frameFuture = remoteEndpoint.sendRawFrame(ByteBuffer.wrap(tempFrame));
futures.put(e.getValue(), frameFuture);
} else {
if (frame == null) {
byte[] byteArrayMessage = new byte[message.remaining()];
message.get(byteArrayMessage);
final Frame dataFrame = new BinaryFrame(byteArrayMessage, false, true);
final ByteBuffer byteBuffer = remoteEndpoint.getSocket().getProtocolHandler().frame(dataFrame);
frame = new byte[byteBuffer.remaining()];
byteBuffer.get(frame);
}