code: public static int decode(byte[] src, int srcOffset, BigInteger[] valueRef)
          throws CorruptEncodingException
      {
          int headerSize;
          int bytesLength;
          byte[] bytes;
  
          try {
              int header = src[srcOffset];
              if (header == NULL_BYTE_HIGH || header == NULL_BYTE_LOW) {
                  valueRef[0] = null;
                  return 1;
              }
  
              header &= 0xff;
  
              if (header > 1 && header < 0xfe) {
                  if (header < 0x80) {
                      bytesLength = 0x80 - header;
                  } else {
                      bytesLength = header - 0x7f;
                  }
                  headerSize = 1;
              } else {
                  bytesLength = Math.abs(DataDecoder.decodeInt(src, srcOffset + 1));
                  headerSize = 5;
              }
  
              bytes = new byte[bytesLength];
              System.arraycopy(src, srcOffset + headerSize, bytes, 0, bytesLength);
          } catch (IndexOutOfBoundsException e) {
              throw new CorruptEncodingException(null, e);
          }
  
          valueRef[0] = new BigInteger(bytes);
          return headerSize + bytesLength;
      }
docs: Decodes the given BigInteger as originally encoded for ascending order.
  
  @param src source of encoded data
  @param srcOffset offset into encoded data
  @param valueRef decoded BigInteger is stored in element 0, which may be null
  @return amount of bytes read from source
  @throws CorruptEncodingException if source data is corrupt
  @since 1.2