public static int decodeDesc ( 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 ] ; srcOffset += headerSize ; for ( int i = 0 ; i < bytesLength ; i ++ ) { bytes [ i ] = ( byte ) ~ src [ srcOffset + i ] ; } } catch ( IndexOutOfBoundsException e ) { throw new CorruptEncodingException ( null , e ) ; } valueRef [ 0 ] = new BigInteger ( bytes ) ; return headerSize + bytesLength ; }
Decodes the given BigInteger as originally encoded for descending order .