Code example for BufferUnderflowException

Methods: initCause

0
        catch ( IndexOutOfBoundsException e ) {
            // 
            // Morph an IndexOutOfBoundsException to a BufferUnderflowException 
            // for consistency. 
            // 
            final BufferUnderflowException bue = new BufferUnderflowException();
            bue.initCause( e );
            throw bue;
        } 
    } 
 
    /** 
     * Gets the given chunk reading it into memory from disk if necessary. 
     * 
     * @param c The chunk index. 
     * @return Returns said chunk. 
     * @throws IllegalArgumentException if <code>c</code> is negative or 
     * greater than the number of chunks comprising the file. 
     */ 
    private synchronized ByteBuffer getChunk( int c ) throws IOException {