MCPcopy Create free account
hub / github.com/Frontrooms/3.0-GC / ByteHelper

Class ByteHelper

src/main/java/emu/grasscutter/utils/ByteHelper.java:3–24  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1package emu.grasscutter.utils;
2
3public class ByteHelper {
4 public static byte[] changeBytes(byte[] a) {
5 byte[] b = new byte[a.length];
6 for (int i = 0; i < a.length; i++) {
7 b[i] = a[a.length - i - 1];
8 }
9 return b;
10 }
11
12 public static byte[] longToBytes(long x) {
13 byte[] bytes = new byte[8];
14 bytes[0] = (byte) (x >> 56);
15 bytes[1] = (byte) (x >> 48);
16 bytes[2] = (byte) (x >> 40);
17 bytes[3] = (byte) (x >> 32);
18 bytes[4] = (byte) (x >> 24);
19 bytes[5] = (byte) (x >> 16);
20 bytes[6] = (byte) (x >> 8);
21 bytes[7] = (byte) (x);
22 return bytes;
23 }
24}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected