public List<ByteString> parseNextBlock(boolean skipIfStartingOnBoundary) throws IOException {
    """
	Finds next block marker and reads the block. If skipIfStartingOnBoundary is set
	skips the the first block if the marker starts exactly at the current position.
	(i.e. there were no bytes from previous block before the start of the marker).
    """
    LOG.debug("BlockReader: none left to read, skipping to sync point");
    long skipped = skipToNextSyncPoint();
    if (skipped <= -1) {
      LOG.debug("BlockReader: SYNC point eof");
      // EOF if there are no more sync markers.
      return null;
    }

    int blockSize = readInt();
    LOG.debug("BlockReader: found sync point, next block has size " + blockSize);
    if (blockSize < 0) {
      LOG.debug("ProtobufReader: reading size after sync point eof");
      // EOF if the size cannot be read.
      return null;
    }

    if (skipIfStartingOnBoundary && skipped == Protobufs.KNOWN_GOOD_POSITION_MARKER.length) {
      // skip the current current block
      in_.skip(blockSize);
      return parseNextBlock(false);
    }

    SerializedBlock block = SerializedBlock.parseFrom(
      new BoundedInputStream(in_, blockSize),
      blockSize);

    curBlobs_ = block.getProtoBlobs();
    numLeftToReadThisBlock_ = curBlobs_.size();
    LOG.debug("ProtobufReader: number in next block is " + numLeftToReadThisBlock_);
    return curBlobs_;
  }
public List<ByteString> parseNextBlock(boolean skipIfStartingOnBoundary) throws IOException {
    LOG.debug("BlockReader: none left to read, skipping to sync point");
    long skipped = skipToNextSyncPoint();
    if (skipped <= -1) {
      LOG.debug("BlockReader: SYNC point eof");
      // EOF if there are no more sync markers.
      return null;
    }

    int blockSize = readInt();
    LOG.debug("BlockReader: found sync point, next block has size " + blockSize);
    if (blockSize < 0) {
      LOG.debug("ProtobufReader: reading size after sync point eof");
      // EOF if the size cannot be read.
      return null;
    }

    if (skipIfStartingOnBoundary && skipped == Protobufs.KNOWN_GOOD_POSITION_MARKER.length) {
      // skip the current current block
      in_.skip(blockSize);
      return parseNextBlock(false);
    }

    SerializedBlock block = SerializedBlock.parseFrom(
      new BoundedInputStream(in_, blockSize),
      blockSize);

    curBlobs_ = block.getProtoBlobs();
    numLeftToReadThisBlock_ = curBlobs_.size();
    LOG.debug("ProtobufReader: number in next block is " + numLeftToReadThisBlock_);
    return curBlobs_;
  }
public List < ByteString > parseNextBlock ( boolean skipIfStartingOnBoundary ) throws IOException { LOG . debug ( "BlockReader: none left to read, skipping to sync point" ) ; long skipped = skipToNextSyncPoint ( ) ; if ( skipped <= - 1 ) { LOG . debug ( "BlockReader: SYNC point eof" ) ; // EOF if there are no more sync markers. return null ; } int blockSize = readInt ( ) ; LOG . debug ( "BlockReader: found sync point, next block has size " + blockSize ) ; if ( blockSize < 0 ) { LOG . debug ( "ProtobufReader: reading size after sync point eof" ) ; // EOF if the size cannot be read. return null ; } if ( skipIfStartingOnBoundary && skipped == Protobufs . KNOWN_GOOD_POSITION_MARKER . length ) { // skip the current current block in_ . skip ( blockSize ) ; return parseNextBlock ( false ) ; } SerializedBlock block = SerializedBlock . parseFrom ( new BoundedInputStream ( in_ , blockSize ) , blockSize ) ; curBlobs_ = block . getProtoBlobs ( ) ; numLeftToReadThisBlock_ = curBlobs_ . size ( ) ; LOG . debug ( "ProtobufReader: number in next block is " + numLeftToReadThisBlock_ ) ; return curBlobs_ ; }
Finds next block marker and reads the block. If skipIfStartingOnBoundary is set
skips the the first block if the marker starts exactly at the current position.
(i.e. there were no bytes from previous block before the start of the marker).
Finds next block marker and reads the block . If skipIfStartingOnBoundary is set skips the the first block if the marker starts exactly at the current position . ( i . e . there were no bytes from previous block before the start of the marker ) .