Code example for BufferUnderflowException

0
    public Buffer get(final ByteBuffer dst) {
        checkDispose(); 
        final int length = dst.remaining();
         
        if (visible.remaining() < length) {
            throw new BufferUnderflowException();
        } 
         
        final int srcPos = visible.position();
        final int oldSrcLim = visible.limit();
        try { 
            visible.limit(srcPos + length);
            dst.put(visible);
        } finally { 
            visible.limit(oldSrcLim);
        } 
         
        return this;
    } 
 
Contextual code suggestions in your IDE  Get Codota for Java