List of usage examples for io.netty.handler.stream ChunkedStream readChunk
@Override public ByteBuf readChunk(ByteBufAllocator allocator) throws Exception
From source file:org.opendaylight.controller.netconf.ssh.threads.Handshaker.java
License:Open Source License
@Override public void run() { ChunkedStream chunkedStream = new ChunkedStream(fromClientIS); try {/*from ww w . jav a 2 s.com*/ ByteBuf byteBuf; while ((byteBuf = chunkedStream .readChunk(channelHandlerContext/*only needed for ByteBuf alloc */)) != null) { serverChannel.writeAndFlush(byteBuf); } } catch (Exception e) { logger.warn("Exception", e); } finally { logger.trace("End of input"); // tear down connection try { onEndOfInput.close(); } catch (Exception e) { logger.warn("Ignoring exception while closing socket", e); } } }