package a.c.c;

import com.google.common.primitives.UnsignedBytes;

public class a {
    public static int a(byte[] bArr) {
        return ((bArr[0] & UnsignedBytes.MAX_VALUE) << 24) | (bArr[3] & UnsignedBytes.MAX_VALUE) | ((bArr[2] & UnsignedBytes.MAX_VALUE) << 8) | ((bArr[1] & UnsignedBytes.MAX_VALUE) << 16);
    }

    public static int a(byte[] bArr, int i) {
        return ((bArr[i] & UnsignedBytes.MAX_VALUE) << 24) | (bArr[i + 3] & UnsignedBytes.MAX_VALUE) | ((bArr[i + 2] & UnsignedBytes.MAX_VALUE) << 8) | ((bArr[i + 1] & UnsignedBytes.MAX_VALUE) << 16);
    }

    public static void a(int i, byte[] bArr, int i2) {
        bArr[i2 + 3] = (byte) (i & 255);
        bArr[i2 + 2] = (byte) ((i >> 8) & 255);
        bArr[i2 + 1] = (byte) ((i >> 16) & 255);
        bArr[i2] = (byte) ((i >> 24) & 255);
    }

    public static void a(long j, byte[] bArr, int i) {
        bArr[i + 7] = (byte) ((int) (j & 255));
        bArr[i + 6] = (byte) ((int) ((j >> 8) & 255));
        bArr[i + 5] = (byte) ((int) ((j >> 16) & 255));
        bArr[i + 4] = (byte) ((int) ((j >> 24) & 255));
        bArr[i + 3] = (byte) ((int) ((j >> 32) & 255));
        bArr[i + 2] = (byte) ((int) ((j >> 40) & 255));
        bArr[i + 1] = (byte) ((int) ((j >> 48) & 255));
        bArr[i] = (byte) ((int) ((j >> 56) & 255));
    }

    public static void a(short s, byte[] bArr, int i) {
        bArr[i + 1] = (byte) (s & 255);
        bArr[i] = (byte) ((s >> 8) & 255);
    }

    public static byte[] a(int i) {
        byte[] bArr = new byte[4];
        bArr[3] = (byte) (i & 255);
        bArr[2] = (byte) ((i >> 8) & 255);
        bArr[1] = (byte) ((i >> 16) & 255);
        bArr[0] = (byte) ((i >> 24) & 255);
        return bArr;
    }

    public static byte[] a(long j) {
        byte[] bArr = new byte[8];
        bArr[7] = (byte) ((int) (j & 255));
        bArr[6] = (byte) ((int) ((j >> 8) & 255));
        bArr[5] = (byte) ((int) ((j >> 16) & 255));
        bArr[4] = (byte) ((int) ((j >> 24) & 255));
        bArr[3] = (byte) ((int) ((j >> 32) & 255));
        bArr[2] = (byte) ((int) ((j >> 40) & 255));
        bArr[1] = (byte) ((int) ((j >> 48) & 255));
        bArr[0] = (byte) ((int) ((j >> 56) & 255));
        return bArr;
    }

    public static byte[] a(short s) {
        byte[] bArr = new byte[2];
        bArr[1] = (byte) (s & 255);
        bArr[0] = (byte) ((s >> 8) & 255);
        return bArr;
    }

    public static long b(byte[] bArr) {
        return ((((long) bArr[0]) & 255) << 56) | ((((long) bArr[1]) & 255) << 48) | ((((long) bArr[2]) & 255) << 40) | ((((long) bArr[3]) & 255) << 32) | ((((long) bArr[4]) & 255) << 24) | ((((long) bArr[5]) & 255) << 16) | ((((long) bArr[6]) & 255) << 8) | (255 & ((long) bArr[7]));
    }

    public static long b(byte[] bArr, int i) {
        return (((long) bArr[i + 7]) & 255) | ((((long) bArr[i]) & 255) << 56) | ((((long) bArr[i + 1]) & 255) << 48) | ((((long) bArr[i + 2]) & 255) << 40) | ((((long) bArr[i + 3]) & 255) << 32) | ((((long) bArr[i + 4]) & 255) << 24) | ((((long) bArr[i + 5]) & 255) << 16) | ((((long) bArr[i + 6]) & 255) << 8);
    }

    public static void b(int i, byte[] bArr, int i2) {
        bArr[i2] = (byte) (i & 255);
    }

    public static void b(long j, byte[] bArr, int i) {
        bArr[i + 3] = (byte) ((int) j);
        bArr[i + 2] = (byte) ((int) ((j >> 8) & 255));
        bArr[i + 1] = (byte) ((int) ((j >> 16) & 255));
        bArr[i] = (byte) ((int) ((j >> 24) & 255));
    }

    public static byte[] b(int i) {
        return new byte[]{(byte) (i & 255)};
    }

    public static byte[] b(long j) {
        byte[] bArr = new byte[4];
        bArr[3] = (byte) ((int) (j & 255));
        bArr[2] = (byte) ((int) ((j >> 8) & 255));
        bArr[1] = (byte) ((int) ((j >> 16) & 255));
        bArr[0] = (byte) ((int) ((j >> 24) & 255));
        return bArr;
    }

    public static short c(byte[] bArr) {
        return (short) (((bArr[0] & UnsignedBytes.MAX_VALUE) << 8) | (bArr[1] & UnsignedBytes.MAX_VALUE));
    }

    public static short c(byte[] bArr, int i) {
        return (short) (((bArr[i] & UnsignedBytes.MAX_VALUE) << 8) | (bArr[i + 1] & UnsignedBytes.MAX_VALUE));
    }

    public static void c(int i, byte[] bArr, int i2) {
        bArr[i2 + 1] = (byte) (i & 255);
        bArr[i2] = (byte) ((i >> 8) & 255);
    }

    public static byte[] c(int i) {
        byte[] bArr = new byte[2];
        bArr[1] = (byte) (i & 255);
        bArr[0] = (byte) ((i >> 8) & 255);
        return bArr;
    }

    public static int d(byte[] bArr) {
        return bArr[0] & UnsignedBytes.MAX_VALUE;
    }

    public static int d(byte[] bArr, int i) {
        return bArr[i] & UnsignedBytes.MAX_VALUE;
    }

    public static long e(byte[] bArr) {
        return ((long) (bArr[3] & UnsignedBytes.MAX_VALUE)) | (((long) (bArr[2] & UnsignedBytes.MAX_VALUE)) << 8) | (((long) (bArr[1] & UnsignedBytes.MAX_VALUE)) << 16) | (((long) (bArr[0] & UnsignedBytes.MAX_VALUE)) << 24);
    }

    public static long e(byte[] bArr, int i) {
        return (((long) (bArr[i] & UnsignedBytes.MAX_VALUE)) << 24) | ((long) (bArr[i + 3] & UnsignedBytes.MAX_VALUE)) | (((long) (bArr[i + 2] & UnsignedBytes.MAX_VALUE)) << 8) | (((long) (bArr[i + 1] & UnsignedBytes.MAX_VALUE)) << 16);
    }

    public static int f(byte[] bArr) {
        return ((bArr[0] & UnsignedBytes.MAX_VALUE) << 8) | (bArr[1] & UnsignedBytes.MAX_VALUE);
    }

    public static int f(byte[] bArr, int i) {
        return ((bArr[i] & UnsignedBytes.MAX_VALUE) << 8) | (bArr[i + 1] & UnsignedBytes.MAX_VALUE);
    }
}
