code: public static final void writeLong(long value, byte[] array, int offset)
      {
          if (array.length < offset + 8)
          {
              throw new IllegalArgumentException("no room in array");
          }
          array[offset] = (byte) (value >> 56);
          array[offset + 1] = (byte) ((value >> 48) & 0xff);
          array[offset + 2] = (byte) ((value >> 40) & 0xff);
          array[offset + 3] = (byte) ((value >> 32) & 0xff);
          array[offset + 4] = (byte) ((value >> 24) & 0xff);
          array[offset + 5] = (byte) ((value >> 16) & 0xff);
          array[offset + 6] = (byte) ((value >> 8) & 0xff);
          array[offset + 7] = (byte) (value & 0xff);
      }
docs: Write value to byte array
  @param value
  @param array
  @param offset
  @see java.nio.ByteBuffer#putLong(long)