@Test public void testubyte2int() { int i; byte[] controlBytes = {(byte) 0xff, (byte) 0x80, (byte) 0x7f}; int[] expectedInts = {255, 128, 127}; for (i = 0; i < controlBytes.length; i++) { assertEquals(expectedInts[i], BitConverters.ubyte2int(controlBytes[i])); } for (i = 0; i < 256; i++) { assertEquals(i, BitConverters.ubyte2int(BitConverters.int2ubyte(i))); } }
public static int ubyte2int(byte in) { return (in >= 0) ? (int) in : (int) in + 256; }
BitConverters { public static int ubyte2int(byte in) { return (in >= 0) ? (int) in : (int) in + 256; } }
BitConverters { public static int ubyte2int(byte in) { return (in >= 0) ? (int) in : (int) in + 256; }  }
BitConverters { public static int ubyte2int(byte in) { return (in >= 0) ? (int) in : (int) in + 256; }  static String int16bit2hex(int i16); static int hex16bit2int(String in); static int nibble2Int(byte nibble); static byte int2Nibble(int in); static int ubyte2int(byte in); static byte int2ubyte(int in); static String byte2hex(byte ubyte); static byte[] uint2bytes(int in); static String bytes2hex(byte[] bytes); }
BitConverters { public static int ubyte2int(byte in) { return (in >= 0) ? (int) in : (int) in + 256; }  static String int16bit2hex(int i16); static int hex16bit2int(String in); static int nibble2Int(byte nibble); static byte int2Nibble(int in); static int ubyte2int(byte in); static byte int2ubyte(int in); static String byte2hex(byte ubyte); static byte[] uint2bytes(int in); static String bytes2hex(byte[] bytes);  }