public static long decodeUnsignedLong ( byte [ ] buf , int ofs , int len ) throws IllegalArgumentException { if ( ofs < 0 || len < 0 || ofs + len < 0 || ofs + len > buf . length ) { throw new IndexOutOfBoundsException ( ) ; } if ( len > 8 || len == 8 && buf [ ofs ] < 0 ) { throw new IllegalArgumentException ( "Integers of at most 63 unsigned bits supported by this implementation" ) ; } long t = 0 ; for ( int i = 0 ; i < len ; ++ i ) { t = ( t << 8 ) | ( ( long ) buf [ ofs + i ] & 0xff ) ; } return t ; }
Decodes an unsigned integer from the given buffer .