@Test public void testByteToUInt8() throws Exception { short number = NumberConversion.byteToUInt8(new byte[]{0x00}); Assert.assertEquals(0, number); number = NumberConversion.byteToUInt8(new byte[]{14}); Assert.assertEquals(14, number); number = NumberConversion.byteToUInt8(new byte[]{(byte) 0x7F}); Assert.assertEquals(127, number); number = NumberConversion.byteToUInt8(new byte[]{(byte) 0xFF}); Assert.assertEquals(255, number); }
public static short byteToUInt8(byte[] arr ,int index){ return (short)(arr[index] & 0xFF); }
NumberConversion { public static short byteToUInt8(byte[] arr ,int index){ return (short)(arr[index] & 0xFF); } }
NumberConversion { public static short byteToUInt8(byte[] arr ,int index){ return (short)(arr[index] & 0xFF); }  }
NumberConversion { public static short byteToUInt8(byte[] arr ,int index){ return (short)(arr[index] & 0xFF); }  static short byteToUInt8(byte[] arr ,int index); static short byteToUInt8(byte[] arr); }
NumberConversion { public static short byteToUInt8(byte[] arr ,int index){ return (short)(arr[index] & 0xFF); }  static short byteToUInt8(byte[] arr ,int index); static short byteToUInt8(byte[] arr);  }