code: 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;
      }
    }
docs: Write long value to given byte array
  
  @param value Value to write, it can be any long value
  @param dest Destination byte array value is written to
  @param offset The starting point of where the value is written
  @throws IllegalArgumentException When input byte array doesn't have enough space to write a
  long