Package java.nio

Examples of java.nio.BufferUnderflowException


        int length = stream.readInt();
        if (stream.available() < length) {
            if (LOG.isLoggable(Level.FINE)) {
                LOG.fine("insufficient data. require " + length + " got "  + stream.available());
            }
            throw new BufferUnderflowException();
   
        } else {
            // ...yes, remove mark
            if  (!removeLengthField) {
                stream.resetToReadMark();
View Full Code Here


                }
            }
        }
     
        if ((data == null) || (data.length < BOM_MAX_LENGTH)) {
            throw new BufferUnderflowException();
        }
        return null;
    }  
View Full Code Here

    int length = stream.readInt();
    if (stream.available() < length) {
      if (LOG.isLoggable(Level.FINE)) {
        LOG.fine("insufficient data. require " + length + " got "  + stream.available());
      }
      throw new BufferUnderflowException();
 
    } else {
      // ...yes, remove mark
      if  (!removeLengthField) {
        stream.resetToReadMark();
View Full Code Here

                }
            }
        }
     
        if ((data == null) || (data.length < BOM_MAX_LENGTH)) {
            throw new BufferUnderflowException();
        }
        return null;
   
View Full Code Here

        @Override
        public void writeTo(Integer message, ByteBuffer buffer) {

            if (buffer.remaining() < 4) {
                throw new BufferUnderflowException();
            }
            for (int i = 0; i < 32; i += 8) {
                buffer.put((byte) (message >> (bo == ByteOrder.BIG_ENDIAN ? 24 - i : i)));
            }
        }
View Full Code Here

                return next;
            }
            try {
                prev = next;
                next = (char) input.read();
                if (next == EOF) throw new BufferUnderflowException();
                return next;
            } catch (IOException ex) {
                throw Throw.exception(ex);
            }
        }
View Full Code Here

            return string.charAt(--pos-1);
        }

        @Override
        public char basicNext() {
            if (pos >= string.length()) throw new BufferUnderflowException();
            return string.charAt(pos++);
        }
View Full Code Here

     * {@inheritDoc}
     */
    public byte get( int pos ) throws IOException {
        final int offsetPos = initialOffset() + pos;
        if ( offsetPos + 1 > limit() )
            throw new BufferUnderflowException();
        synchronized ( this ) {
            return getRAF( offsetPos ).readByte();
        }
    }
View Full Code Here

        throws IOException
    {
        final int pos = position();
        final int offsetPos = initialOffset() + pos;
        if ( offsetPos + length > limit() )
            throw new BufferUnderflowException();
        int totalBytesRead = 0;
        synchronized ( this ) {
            final RandomAccessFile raf = getRAF( offsetPos );
            while ( true ) {
                final int bytesRead = raf.read( dest, offset, length );
View Full Code Here

     * {@inheritDoc}
     */
    public double getDouble( int pos ) throws IOException {
        final int offsetPos = initialOffset() + pos;
        if ( offsetPos + 8 > limit() )
            throw new BufferUnderflowException();
        long value;
        synchronized ( this ) {
            value = getRAF( offsetPos ).readLong();
        }
        if ( order() == ByteOrder.LITTLE_ENDIAN )
View Full Code Here

TOP

Related Classes of java.nio.BufferUnderflowException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.