ByteBuf buf = channel.alloc().buffer();
buf.writeInt(dataLength);
buf.writeBytes(data, 0, dataLength);
ChannelFuture channelFuture = channel.writeAndFlush(buf);
if (channelFuture.cause() != null) {
throw channelFuture.cause();
}
} catch (IOException ioe) {
markClosed(ioe);
} catch (Throwable t) {