format/src/main/java/com/github/sadikovi/riff/IndexedRowReader.java
/**
   * Read row from input stream. This should reflect write logic in `IndexedRowWriter`. We check
   * magic byte and buffer optional null bit set; then copy index region and data region into
   * indexed row.
   * @param in input stream to read from
   * @return indexed row as InternalRow
   * @throws IOException
   */
Read row from input stream. This should reflect write logic in `IndexedRowWriter`. We check
magic byte and buffer optional null bit set; then copy index region and data region into
indexed row.
@param in input stream to read from
@return indexed row as InternalRow
@throws IOException
Read row from input stream . This should reflect write logic in ` IndexedRowWriter ` . We check magic byte and buffer optional null bit set ; then copy index region and data region into indexed row . @param in input stream to read from @return indexed row as InternalRow @throws IOException
public InternalRow readRow(InStream in) throws IOException {
    IndexedRow row = readRowHeader(in);
    int indexBytes = in.readInt();
    if (indexBytes > 0) {
      byte[] indexRegion = new byte[indexBytes];
      in.read(indexRegion, 0, indexBytes);
      row.setIndexRegion(indexRegion);
    }
    int dataBytes = in.readInt();
    if (dataBytes > 0) {
      byte[] dataRegion = new byte[dataBytes];
      in.read(dataRegion, 0, dataBytes);
      row.setDataRegion(dataRegion);
    }
    return row;
  }
public InternalRow readRow ( InStream in ) throws IOException { IndexedRow row = readRowHeader ( in ) ; int indexBytes = in . readInt ( ) ; if ( indexBytes > 0 ) { byte [ ] indexRegion = new byte [ indexBytes ] ; in . read ( indexRegion , 0 , indexBytes ) ; row . setIndexRegion ( indexRegion ) ; } int dataBytes = in . readInt ( ) ; if ( dataBytes > 0 ) { byte [ ] dataRegion = new byte [ dataBytes ] ; in . read ( dataRegion , 0 , dataBytes ) ; row . setDataRegion ( dataRegion ) ; } return row ; }
Read row from input stream.
Read row from input stream .
// read index region, note that if no bytes were written, we do not set index region at all // read data region, similarly we do not initialize data region, if no bytes were written