package com.encrox.twitchbot.client; import java.nio.ByteBuffer; import java.util.Arrays; public class Utils { public static int ba_to_int(byte[] arr) { return ByteBuffer.wrap(arr).getInt(); } public static byte[] int_to_ba(int integer) { return ByteBuffer.allocate(4).putInt(integer).array(); } public static short ba_to_short(byte[] arr) { return ByteBuffer.wrap(arr).getShort(); } public static byte[] short_to_ba(short s) { return ByteBuffer.allocate(2).putShort(s).array(); } public static byte[] fill(byte[] arr, int length) { if(length <= arr.length) return arr; byte[] output = new byte[length]; for(int i = 0; i