code: public static void longToBytes(long value, byte[] bytes, int offset) {
          for (int i = offset + 7; i >= offset; --i) {
              bytes[i] = (byte) value;
              value = value >> 8;
          }
      }
docs: A utility method to convert the long into bytes in an array.
  
  @param value
  The long.
  @param bytes
  The byte array to which the long should be copied.
  @param offset
  The index where the long should start.