protected long writeCodedValues(final PrefixCoder coder,final IRaba raba,final Byte2Symbol byte2symbol,final long[] codedValueOffset,final OutputBitStream obs) throws IOException {
  final int nvalues=raba.size();
  if (codedValueOffset != null) {
    if (codedValueOffset.length != nvalues + 1)     throw new IllegalArgumentException();
  }
  long bitsWritten=0L;
  for (int i=0; i < nvalues; i++) {
    if (codedValueOffset != null)     codedValueOffset[i]=bitsWritten;
    final byte[] a=raba.get(i);
    if (a != null) {
      for (      byte b : a) {
        final int symbol=byte2symbol.byte2symbol(b);
        if (symbol == -1)         throw new UnsupportedOperationException("Can not code value: " + b);
        bitsWritten+=coder.encode(symbol,obs);
      }
    }
  }
  if (codedValueOffset != null)   codedValueOffset[nvalues]=bitsWritten;
  if (log.isDebugEnabled())   log.debug("codedValueOffset[]=" + Arrays.toString(codedValueOffset));
  return bitsWritten;
}

protected long writeCodedValues ( final PrefixCoder coder , final IRaba raba , final Byte2Symbol byte2symbol , final long [ ] codedValueOffset , final OutputBitStream obs ) throws IOException { final int nvalues = raba . size ( ) ; if ( codedValueOffset != null ) { if ( codedValueOffset . length != nvalues + 1 ) throw new IllegalArgumentException ( ) ; } long bitsWritten = 0L ; for ( int i = 0 ; i < nvalues ; i ++ ) { if ( codedValueOffset != null ) codedValueOffset [ i ] = bitsWritten ; final byte [ ] a = raba . get ( i ) ; if ( a != null ) { for ( byte b : a ) { final int symbol = byte2symbol . byte2symbol ( b ) ; if ( symbol == - 1 ) throw new UnsupportedOperationException ( "Can not code value: " + b ) ; bitsWritten += coder . encode ( symbol , obs ) ; } } } if ( codedValueOffset != null ) codedValueOffset [ nvalues ] = bitsWritten ; if ( log . isDebugEnabled ( ) ) log . debug ( "codedValueOffset[]=" + Arrays . toString ( codedValueOffset ) ) ; return bitsWritten ; }
write out the coded values .
