Java Utililty Methods ReadableByteChannel Copy

List of utility methods to do ReadableByteChannel Copy

Description

The list of methods to do ReadableByteChannel Copy are organized into topic(s).

Method

voidfastCopy(final ReadableByteChannel src, final WritableByteChannel dest)
An efficient copy between two channels with a fixed-size buffer.
final ByteBuffer buffer = ByteBuffer.allocateDirect(16 * 1024);
while (src.read(buffer) != -1) {
    buffer.flip();
    dest.write(buffer);
    buffer.compact();
buffer.flip();
while (buffer.hasRemaining()) {
...