format/src/main/java/com/github/sadikovi/riff/io/OutStream.java
/**
   * Write header into buffer, this includes total bytes per chunk and whether or not chunk is
   * compressed. Data should be written at provided position up to HEADER_SIZE.
   * @param buf buffer to write into
   * @param pos start position
   * @param bytes total bytes per chunk
   * @param isCompressed true if chunk is compressed, false otherwise
   */
Write header into buffer, this includes total bytes per chunk and whether or not chunk is
compressed. Data should be written at provided position up to HEADER_SIZE.
@param buf buffer to write into
@param pos start position
@param bytes total bytes per chunk
@param isCompressed true if chunk is compressed, false otherwise
Write header into buffer this includes total bytes per chunk and whether or not chunk is compressed . Data should be written at provided position up to HEADER_SIZE . @param buf buffer to write into @param pos start position @param bytes total bytes per chunk @param isCompressed true if chunk is compressed false otherwise
protected static void writeHeader(ByteBuffer buf, int pos, int bytes, boolean isCompressed) {
    if (bytes < 0) throw new IllegalArgumentException("Invalid bytes " + bytes);
    bytes |= (isCompressed) ? (1 << 31) : 0;
    buf.putInt(pos, bytes);
  }
protected static void writeHeader ( ByteBuffer buf , int pos , int bytes , boolean isCompressed ) { if ( bytes < 0 ) throw new IllegalArgumentException ( "Invalid bytes " + bytes ) ; bytes |= ( isCompressed ) ? ( 1 << 31 ) : 0 ; buf . putInt ( pos , bytes ) ; }
Write header into buffer, this includes total bytes per chunk and whether or not chunk is
 compressed.
Write header into buffer this includes total bytes per chunk and whether or not chunk is compressed .
// we write 4 bytes - bytes is expected to be non-negative signed integer, we insert // information about compression as highest bit