private byte[] bufX( long bias, int scale, int off, int log ) {
    byte[] bs = new byte[(_len<<log)+off];
    int j = 0;
    for( int i=0; i<_len; i++ ) {
      long le = -bias;
      if(_id == null || _id.length == 0 || (j < _id.length && _id[j] == i)){
        if( isNA2(j) ) {
          le = NAS[log];
        } else {
          int x = (_xs[j]==Integer.MIN_VALUE+1 ? 0 : _xs[j])-scale;
          le += x >= 0
              ? _ls[j]*PrettyPrint.pow10i( x)
              : _ls[j]/PrettyPrint.pow10i(-x);
        }
        ++j;
      }
      switch( log ) {
        case 0:          bs [i    +off] = (byte)le ; break;
        case 1: UDP.set2(bs,(i<<1)+off,  (short)le); break;
        case 2: UDP.set4(bs,(i<<2)+off,    (int)le); break;
        case 3: UDP.set8(bs,(i<<3)+off,         le); break;
        default: throw H2O.fail();
      }
    }
    assert j == _sparseLen:"j = " + j + ", len = " + _sparseLen + ", len2 = " + _len + ", id[j] = " + _id[j];
    return bs;
  }
private byte [ ] bufX ( long bias , int scale , int off , int log ) { byte [ ] bs = new byte [ ( _len << log ) + off ] ; int j = 0 ; for ( int i = 0 ; i < _len ; i ++ ) { long le = - bias ; if ( _id == null || _id . length == 0 || ( j < _id . length && _id [ j ] == i ) ) { if ( isNA2 ( j ) ) { le = NAS [ log ] ; } else { int x = ( _xs [ j ] == Integer . MIN_VALUE + 1 ? 0 : _xs [ j ] ) - scale ; le += x >= 0 ? _ls [ j ] * PrettyPrint . pow10i ( x ) : _ls [ j ] / PrettyPrint . pow10i ( - x ) ; } ++ j ; } switch ( log ) { case 0 : bs [ i + off ] = ( byte ) le ; break ; case 1 : UDP . set2 ( bs , ( i << 1 ) + off , ( short ) le ) ; break ; case 2 : UDP . set4 ( bs , ( i << 2 ) + off , ( int ) le ) ; break ; case 3 : UDP . set8 ( bs , ( i << 3 ) + off , le ) ; break ; default : throw H2O . fail ( ) ; } } assert j == _sparseLen : "j = " + j + ", len = " + _sparseLen + ", len2 = " + _len + ", id[j] = " + _id [ j ] ; return bs ; }
Compute a compressed integer buffer