Code example for BufferUnderflowException

0
        throws IOException, BufferUnderrunException
    { 
    	// TODO - are these ~Field used / necessary 
    	int ib = stream.read();
    	if (ib < 0) {
    		throw new BufferUnderflowException();
    	} 
        _value = (byte) ib;
    } 
 
    /** 
     * write the value out to an array of bytes at the appropriate 
     * offset 
     * 
     * @param data the array of bytes to which the value is to be 
     *             written 
     * 
     * @exception ArrayIndexOutOfBoundsException if the offset is out 
     *            of the byte array's range 
     */