private int doWriteChunk(final ByteBuffer src, final boolean direct) throws IOException { if (direct) { final int bytesWritten = this.channel.write(src); if (bytesWritten > 0) { this.metrics.incrementBytesTransferred(bytesWritten); } return bytesWritten; } else { final int chunk = src.remaining(); this.buffer.write(src); return chunk; } }
private int doWriteChunk(final ByteBuffer src, final boolean direct) throws IOException { if (direct) { final int bytesWritten = this.channel.write(src); if (bytesWritten > 0) { this.metrics.incrementBytesTransferred(bytesWritten); } return bytesWritten; } else { final int chunk = src.remaining(); this.buffer.write(src); return chunk; } }