Package io.netty.buffer

Examples of io.netty.buffer.ByteBufInputStream.available()


    // the Math.min with the end of the buffer should fix it but now I'm not getting results back, leaving it here for now
    // because it is needed, but there might be a problem with it
    ByteBufInputStream f = new ByteBufInputStream(parentColumnReader.parentReader.getBufferWithAllData().slice(
        (int) parentColumnReader.readPositionInBuffer,
        Math.min(200, parentColumnReader.parentReader.getBufferWithAllData().capacity() - (int) parentColumnReader.readPositionInBuffer)));
    int before = f.available();
    PageHeader pageHeader = readPageHeader(f);
    int length = before - f.available();
    f = new ByteBufInputStream(parentColumnReader.parentReader.getBufferWithAllData().slice(
        (int) parentColumnReader.readPositionInBuffer + length, pageHeader.getCompressed_page_size()));
View Full Code Here


    ByteBufInputStream f = new ByteBufInputStream(parentColumnReader.parentReader.getBufferWithAllData().slice(
        (int) parentColumnReader.readPositionInBuffer,
        Math.min(200, parentColumnReader.parentReader.getBufferWithAllData().capacity() - (int) parentColumnReader.readPositionInBuffer)));
    int before = f.available();
    PageHeader pageHeader = readPageHeader(f);
    int length = before - f.available();
    f = new ByteBufInputStream(parentColumnReader.parentReader.getBufferWithAllData().slice(
        (int) parentColumnReader.readPositionInBuffer + length, pageHeader.getCompressed_page_size()));

    BytesInput bytesIn = parentColumnReader.parentReader.getCodecFactoryExposer()
        .decompress(BytesInput.from(f, pageHeader.compressed_page_size), pageHeader.getUncompressed_page_size(),
View Full Code Here

    int dBodyLength = 0;

    // read the data body.
    if (buffer.readableBytes() > 0) {
     
      if(RpcConstants.EXTRA_DEBUGGING) logger.debug("Reading raw body, buffer has {} bytes available, is available {}.", buffer.readableBytes(), is.available());
      checkTag(is, RpcEncoder.RAW_BODY_TAG);
      dBodyLength = readRawVarint32(is);
      if(buffer.readableBytes() != dBodyLength) throw new CorruptedFrameException(String.format("Expected to receive a raw body of %d bytes but received a buffer with %d bytes.", dBodyLength, buffer.readableBytes()));
      dBody = buffer.slice();
      dBody.retain();
View Full Code Here

    // read the data body.
    if (buffer.readableBytes() > 0) {

      if (RpcConstants.EXTRA_DEBUGGING) {
        logger.debug("Reading raw body, buffer has {} bytes available, is available {}.", buffer.readableBytes(), is.available());
      }
      checkTag(is, RpcEncoder.RAW_BODY_TAG);
      dBodyLength = readRawVarint32(is);
      if (buffer.readableBytes() != dBodyLength) {
        throw new CorruptedFrameException(String.format("Expected to receive a raw body of %d bytes but received a buffer with %d bytes.", dBodyLength, buffer.readableBytes()));
View Full Code Here

                    outOffset += read;
                } else {
                    break;
                }
            }
            assertEquals(0, is.available());
            assertEquals(-1, is.read());

            is.close();
            lzmaIs.close();
            msg.release();
View Full Code Here

            } else {
                break;
            }
        }

        assertEquals(0, is.available());
        assertEquals(-1, is.read());
        assertEquals(-1, lzmaIs.read());

        is.close();
        lzmaIs.close();
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.