Code example for ByteBuffer

Methods: hasRemaining

0
            } 
        } 
        return readCount;
    } 
 
    /** 
     * @see java.nio.channels.SocketChannel#read(java.nio.ByteBuffer[], int, 
     *      int) 
     */ 
    @Override 
    public long read(ByteBuffer[] targets, int offset, int length)
            throws IOException { 
        if (!isIndexValid(targets, offset, length)) {
            throw new IndexOutOfBoundsException();
        } 
 
        checkOpenConnected(); 
        int totalCount = calculateByteBufferArray(targets, offset, length);
        if (0 == totalCount) {
            return 0; 
        }