protected static void checkBytes(byte[] bytes, int offset, int length, int expectedLength) { checkBytesNotNull(bytes); ByteBuffer.checkOffsetLength(bytes.length, offset, length); if (length != expectedLength) { throw new IllegalArgumentException("Unexpected length of byte array [expected=" + expectedLength + ", actual=" + length + "]"); } }
protected static void checkBytes(byte[] bytes, int offset, int length, int expectedLength) { checkBytesNotNull(bytes); ByteBuffer.checkOffsetLength(bytes.length, offset, length); if (length != expectedLength) { throw new IllegalArgumentException("Unexpected length of byte array [expected=" + expectedLength + ", actual=" + length + "]"); } }
public static short toShort(byte[] bytes) { checkBytesNotNull(bytes); return toShort(bytes, 0, bytes.length); }
public static int toInt(byte[] bytes) { checkBytesNotNull(bytes); return toInt(bytes, 0, bytes.length); }
public static long toUnsignedInt(byte[] bytes) { checkBytesNotNull(bytes); return toUnsignedInt(bytes, 0, bytes.length); }
public static short toShort(byte[] bytes) { checkBytesNotNull(bytes); return toShort(bytes, 0, bytes.length); }
public static byte toByte(byte[] bytes) { checkBytesNotNull(bytes); return toByte(bytes, 0, bytes.length); }
public static byte toByte(byte[] bytes) { checkBytesNotNull(bytes); return toByte(bytes, 0, bytes.length); }
public static short toUnsignedByte(byte[] bytes) { checkBytesNotNull(bytes); return toUnsignedByte(bytes, 0, bytes.length); }
public static short toUnsignedByte(byte[] bytes) { checkBytesNotNull(bytes); return toUnsignedByte(bytes, 0, bytes.length); }
public static int toUnsignedShort(byte[] bytes) { checkBytesNotNull(bytes); return toUnsignedShort(bytes, 0, bytes.length); }
public static int toInt(byte[] bytes) { checkBytesNotNull(bytes); return toInt(bytes, 0, bytes.length); }
public static long toLong(byte[] bytes) { checkBytesNotNull(bytes); return toLong(bytes, 0, bytes.length); }
public static int toUnsignedShort(byte[] bytes) { checkBytesNotNull(bytes); return toUnsignedShort(bytes, 0, bytes.length); }
public static long toUnsignedInt(byte[] bytes) { checkBytesNotNull(bytes); return toUnsignedInt(bytes, 0, bytes.length); }
public static long toLong(byte[] bytes) { checkBytesNotNull(bytes); return toLong(bytes, 0, bytes.length); }