public byte [ ] getLengthEncodedBytes ( ) { int type = this . buf [ this . position ++ ] & 0xff ; int length ; switch ( type ) { case 251 : return null ; case 252 : length = 0xffff & readShort ( ) ; break ; case 253 : length = 0xffffff & read24bitword ( ) ; break ; case 254 : length = ( int ) ( ( buf [ position ++ ] & 0xff ) + ( ( long ) ( buf [ position ++ ] & 0xff ) << 8 ) + ( ( long ) ( buf [ position ++ ] & 0xff ) << 16 ) + ( ( long ) ( buf [ position ++ ] & 0xff ) << 24 ) + ( ( long ) ( buf [ position ++ ] & 0xff ) << 32 ) + ( ( long ) ( buf [ position ++ ] & 0xff ) << 40 ) + ( ( long ) ( buf [ position ++ ] & 0xff ) << 48 ) + ( ( long ) ( buf [ position ++ ] & 0xff ) << 56 ) ) ; break ; default : length = type ; break ; } byte [ ] tmpBuf = new byte [ length ] ; System . arraycopy ( buf , position , tmpBuf , 0 , length ) ; position += length ; return tmpBuf ; }
Get next data bytes with length encoded prefix .