public static void writeLong ( long value , byte [ ] dest , int offset ) throws IllegalArgumentException { if ( dest . length < offset + 8 ) { throw new IllegalArgumentException ( "Destination byte array does not have enough space to write long from offset " + offset ) ; } long t = value ; for ( int i = offset ; i < offset + 8 ; i ++ ) { dest [ i ] = ( byte ) ( t & 0xff ) ; t = t >> 8 ; } }
Write long value to given byte array