format/src/main/java/com/github/sadikovi/riff/StripeInformation.java
/**
   * Write stripe information into external stream.
   * @param buffer output buffer
   * @throws IOException
   */
Write stripe information into external stream.
@param buffer output buffer
@throws IOException
Write stripe information into external stream . @param buffer output buffer @throws IOException
public void writeExternal(OutputBuffer buffer) throws IOException {
    byte flags = 0;
    flags |= hasStatistics() ? 1 : 0;
    flags |= hasColumnFilters() ? 2 : 0;
    buffer.writeByte(MAGIC);
    buffer.writeByte(flags);
    buffer.writeShort(id());
    buffer.writeLong(offset());
    buffer.writeInt(length());
    if (hasStatistics()) {
      buffer.writeInt(stats.length);
      for (Statistics obj : stats) {
        if (obj == null) {
          throw new NullPointerException("Encountered null statistics for stripe " + this);
        }
        obj.writeExternal(buffer);
      }
    }
    if (hasColumnFilters()) {
      buffer.writeInt(filters.length);
      for (ColumnFilter obj : filters) {
        if (obj == null) {
          throw new NullPointerException("Encountered null column filter for stripe " + this);
        }
        obj.writeExternal(buffer);
      }
    }
  }
public void writeExternal ( OutputBuffer buffer ) throws IOException { byte flags = 0 ; flags |= hasStatistics ( ) ? 1 : 0 ; flags |= hasColumnFilters ( ) ? 2 : 0 ; buffer . writeByte ( MAGIC ) ; buffer . writeByte ( flags ) ; buffer . writeShort ( id ( ) ) ; buffer . writeLong ( offset ( ) ) ; buffer . writeInt ( length ( ) ) ; if ( hasStatistics ( ) ) { buffer . writeInt ( stats . length ) ; for ( Statistics obj : stats ) { if ( obj == null ) { throw new NullPointerException ( "Encountered null statistics for stripe " + this ) ; } obj . writeExternal ( buffer ) ; } } if ( hasColumnFilters ( ) ) { buffer . writeInt ( filters . length ) ; for ( ColumnFilter obj : filters ) { if ( obj == null ) { throw new NullPointerException ( "Encountered null column filter for stripe " + this ) ; } obj . writeExternal ( buffer ) ; } } }
Write stripe information into external stream.
Write stripe information into external stream .
// flag per bit, e.g. stripe has statistics, etc. // stripe identifiers and flags // stripe stream information // stripe statistics information // statistics instance should never be null // stripe filters information // filters instance should never be null