Code example for ReadableByteChannel

Methods: read

0
            throw new IllegalArgumentException("Byte buffer may not be null");
        } 
        if (this.completed) {
            return -1; 
        } 
        int bytesRead = this.channel.read(dst);
        if (bytesRead == -1) {
            this.completed = true;
        } 
        return bytesRead;
    } 
 
    public boolean isCompleted() { 
        return this.completed;
    } 
 
}