Package java.nio

Examples of java.nio.BufferOverflowException


        dataPos += len;
      }
 
      void  writeChecksum(byte[] inarray, int off, int len) {
        if (checksumPos + len > dataStart) {
          throw new BufferOverflowException();
        }
        System.arraycopy(inarray, off, buf, checksumPos, len);
        checksumPos += len;
      }
View Full Code Here


            if (messageLen < 0) {
                messageLen = getMessageLength();
                if (messageLen >= 0) {
                    if (readBuffer.limit() < messageLen) {
      /* Buffer is too small to hold complete message */
                        throw new BufferOverflowException();
                    }
                }
            }
            if (messageLen >= 0 && readBuffer.position() >= messageLen) {
                if (logger.isLoggable(Level.FINER)) {
View Full Code Here

        int oldLimit = limit();
        int end = position() + fieldSize;

        if (oldLimit < end) {
            throw new BufferOverflowException();
        }

        if (val.length() == 0) {
            if (!utf16) {
                put((byte) 0x00);
View Full Code Here

  public void commit(char[] replaceWith, int startReplace, int endReplace) {
    if (startReplace < inPos) {
      throw new BufferUnderflowException();
    }
    if (endReplace > in.length) {
      throw new BufferOverflowException();
    }

    // commit any characters up to the beginning of the replacement
    out.write(in, inPos, startReplace - inPos);
View Full Code Here

        }

        public void put(ByteBuffer src) {
            int length = src.remaining();
            if (length > remaining())
                throw new BufferOverflowException();

            for (ByteBuffer buffer : bufferList) {
                int remaining = buffer.remaining();
                if (remaining > 0) {
                    if (length > remaining) {
View Full Code Here

                int oldLimit = limit();
                int end = position() + fieldSize;

                if (oldLimit < end) {
                    throw new BufferOverflowException();
                }

                if (val.length() == 0) {
                    if (!utf16) {
                        put((byte) 0x00);
View Full Code Here

   * @param value The byte value to be written
   * @return This buffer
   */
  public DoubleHalfBuffer put(int position, byte value){
    if(readOnly) throw new ReadOnlyBufferException();
    if(position >= limit) throw new BufferOverflowException();
    if(position < firstLimit) firstBuffer.put(position, value);
    else secondBuffer.put(position - firstLimit, value);
    return this;
  }
View Full Code Here

   * @param length Number of bytes to put.
   * @return This buffer
   */
  public DoubleHalfBuffer put(byte[] src, int offset, int length){
    if(readOnly) throw new ReadOnlyBufferException();
    if(remaining() < length) throw new BufferOverflowException();
    if(offset < 0 || length < 0 || offset + length > src.length) throw new IndexOutOfBoundsException();
    if(position >= firstLimit){
      secondBuffer.position(position - firstLimit);
      secondBuffer.put(src, offset, length);
      secondBuffer.rewind();
View Full Code Here

      maxChunks = chunksPerPkt;
    }

    void writeData(byte[] inarray, int off, int len) {
      if (dataPos + len > buf.length) {
        throw new BufferOverflowException();
      }
      System.arraycopy(inarray, off, buf, dataPos, len);
      dataPos += len;
    }
View Full Code Here

      dataPos += len;
    }

    void writeChecksum(byte[] inarray, int off, int len) {
      if (checksumPos + len > dataStart) {
        throw new BufferOverflowException();
      }
      System.arraycopy(inarray, off, buf, checksumPos, len);
      checksumPos += len;
    }
View Full Code Here

TOP

Related Classes of java.nio.BufferOverflowException

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.