int available = channelSink.inputStream.available();
byte[] buffer = new byte[available];
int read = channelSink.inputStream.read(buffer);
if (read > 0) {
ChannelBuffer channelBuffer = ChannelBuffers.wrappedBuffer(buffer, 0, read);
UpstreamMessageEvent upstreamMessageEvent = new UpstreamMessageEvent(
channelSink.channel,
channelBuffer,
channelSink.getRemoteAddress()
);
channelSink.channel.getPipeline().sendUpstream(upstreamMessageEvent);