/** {@inheritDoc} */ @Override public void onAllDataRead() throws IOException { close(); }
/** * @throws IOException */ @Override public void onAllDataRead() throws IOException { close(); }
/** * {@inheritDoc} * * Writes all the received data to the output channel */ @Override public void onDataAvailable() throws IOException { while (in.isReady()) { if (inChannel.read(buffer) > 0) { buffer.flip(); channel.write(buffer); buffer.compact(); } else { buffer.flip(); while (buffer.hasRemaining()) { channel.write(buffer); } close(); return; } } }
/** * Writes all the received data to the output channel * * @throws IOException */ @Override public void onDataAvailable() throws IOException { while (in.isReady()) { if (inChannel.read(buffer) > 0) { buffer.flip(); channel.write(buffer); buffer.compact(); } else { buffer.flip(); while (buffer.hasRemaining()) { channel.write(buffer); } close(); return; } } }