public static void intToBigEndian(int n, byte[] bs, int off) {
        bs[off] = (byte) (n >>> 24);
        bs[++off] = (byte) (n >>> 16);
        bs[++off] = (byte) (n >>> 8);
        bs[++off] = (byte) (n);
    }
Utility methods for converting byte arrays into ints and longs, and back again.
turms-server-common/src/main/java/org/bouncycastle/util/Pack.java