public static void encodeTimestamp(byte[] array,int pointer,double timestamp){
  for (int i=0; i < 8; i++) {
    double base=Math.pow(2,(3 - i) * 8);
    array[pointer + i]=(byte)(timestamp / base);
    timestamp=timestamp - (double)(unsignedByteToShort(array[pointer + i]) * base);
  }
  array[7]=(byte)(Math.random() * 255.0);
}

public static void encodeTimestamp ( byte [ ] array , int pointer , double timestamp ) { for ( int i = 0 ; i < 8 ; i ++ ) { double base = Math . pow ( 2 , ( 3 - i ) * 8 ) ; array [ pointer + i ] = ( byte ) ( timestamp / base ) ; timestamp = timestamp - ( double ) ( unsignedByteToShort ( array [ pointer + i ] ) * base ) ; } array [ 7 ] = ( byte ) ( Math . random ( ) * 255.0 ) ; }
encodes a timestamp in the specified position in the message
