public void handleEvent(StreamConnection channel) {
StreamSourceChannel readChannel = channel.getSourceChannel();
StreamSinkChannel writeChannel = channel.getSinkChannel();
//set read and write timeouts
if (channel.supportsOption(Options.READ_TIMEOUT)) {
readChannel = new ReadTimeoutStreamSourceChannel(readChannel);
}
if (channel.supportsOption(Options.WRITE_TIMEOUT)) {
writeChannel = new WriteTimeoutStreamSinkChannel(writeChannel);
}
final PushBackStreamChannel pushBackStreamChannel = new PushBackStreamChannel(readChannel);