class ChannelInput {

    public void read(byte[] dst, int offset, int length) throws IOException {
        for (; length > 0; ) {
            int remaining = buffer.remaining();
            if (length <= remaining) {
                buffer.get(dst, offset, length);
                break;
            }
            buffer.get(dst, offset, remaining);
            offset += remaining;
            length -= remaining;
            fill();
        }
    }

      ChannelInput(FileChannel channel, int position, int bufferSize);

}