Package java.nio

Examples of java.nio.BufferUnderflowException


    final ByteBuffer buffer = this.rwBlock.getByteBuffer();
    final int length = (int) headerReader.readLength(buffer);

    if (length < 0 || length > 65 * 1024) {
      throw new BufferUnderflowException();
    }

    if (this.rwBlock.checkBoundsRegional(regional, length) == false) {
      setupBuffer(BUFFER_SIZE, buffer);
    }
View Full Code Here


    if (read == -1) {
      throw new EOFException();
    }

    if (read < length) {
      throw new BufferUnderflowException();
    }

    this.buffer.position(regional);

    /*
 
View Full Code Here

    final int allocation = this.loader.getBufferAllocation(length);

    if (this.blockBuffer.checkBoundsRegional(regional, length) == false) {

      if (length > allocation) {
        throw new BufferUnderflowException();
      }

      this.blockBuffer = this.loader.fetchBlock(regional, length);
    }
View Full Code Here

      if (length > allocation) {
        AbstractRawIterator.logger.error("Record's length (" + length
            + ") is greater then prefetch buffer size (" + allocation
            + ") at record position (" + this.global + ")");
        throw new BufferUnderflowException();
      }

      this.blockBuffer = this.loader.fetchBlock(regional, length);
    }
View Full Code Here

    final long length = lengthGetter.readLength(buffer);

    if (length < 0) {
      AbstractRawIterator.logger.error("Invalid record length value (" + length
          + ") at record position (" + this.global + ")");
      throw new BufferUnderflowException();
    }

    return length;
  }
View Full Code Here

    final long length = headerReader.readLength(buffer);

    if ((length < 0) || (length > 100000)) {
      AbstractRawIterator.logger.error("Invalid record length value (" + length
          + ") at record position (" + this.global + ")");
      throw new BufferUnderflowException();
    }

    return length;
  }
View Full Code Here

            + ") is greater then prefetch buffer size (" + allocation
            + ") at record position (" + this.global + ")");
        if (pattern.match(buffer)) {
          logger.info("Erroneous record passes the search pattern test");
        }
        throw new BufferUnderflowException();
      }

      this.blockBuffer = this.loader.fetchBlock(regional, length);
    }
View Full Code Here

    this.buffer.position(p);

    final int length = lengthReader.readLength(this.buffer);
    if (p + length > this.bufferSize) {
      if (length > this.getBufferAllocation()) {
        throw new BufferUnderflowException();
      }
      this.resetBuffer();
      return this.nextRecord(lengthReader);
    }
View Full Code Here

      long r=getNextReadIndex(timeout,mark);
      if(mark>r){
        return res;
      }
      if(mark<minIndex){
        throw new BufferUnderflowException();
      }
      int k;
            if(mark < 0){
                mark = -1;
            }
            k = (int)((mark+1)%bufferSize);

            int c=(int)(r-mark);
      for(int i=0;i<c;i++){
        int x=(k+i)%(int) bufferSize;
        readBuffer.limit(x*streamMaxSize+lengths[x]);
        readBuffer.position(x*streamMaxSize);
        ByteBuffer bb=readBuffer.slice();
        try {
          factory.add(bb);
        } catch (PacketBufferValidationError e) {
          validationErrorControl(e);
        }
        res+=lengths[x];
      }
      if(mark<minIndex){
        throw new BufferUnderflowException();
      }
      mark=r;
      return res;
    }
View Full Code Here

      long r=getNextReadIndex(timeout,mark);
      if(mark>r){
        return res;
      }
      if(mark<minIndex){
        throw new BufferUnderflowException();
      }
            int k;
            if(mark < 0){
                k = 0;
            }else{
                k = (int)(mark%bufferSize);
            }
      int c=(int)(r-mark);
      for(int i=0;i<c;i++){
        int x=k+i;
        if(x==bufferSize) x=0;
        readBuffer.limit(x*streamMaxSize+lengths[x]);
        readBuffer.position(x*streamMaxSize);
        channel.write(readBuffer);
        res+=lengths[x];
      }
      if(mark<minIndex){
        throw new BufferUnderflowException();
      }
      mark=r;
      return res;
    }
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.