@Test public void testGetBytesLong() { assertArrayEquals(new byte[] { (byte) 0x90, 0x78, 0x45, 0x23, 0x01, (byte) 0xEF, (byte) 0xCD, (byte) 0xAB }, BitConverter.getBytes(0xABCDEF0123457890L)); }
public static byte[] getBytes(short v) { byte[] writeBuffer = new byte[2]; writeBuffer[0] = (byte) ((v >>> 0) & 0xFF); writeBuffer[1] = (byte) ((v >>> 8) & 0xFF); return writeBuffer; }
BitConverter { public static byte[] getBytes(short v) { byte[] writeBuffer = new byte[2]; writeBuffer[0] = (byte) ((v >>> 0) & 0xFF); writeBuffer[1] = (byte) ((v >>> 8) & 0xFF); return writeBuffer; } }
BitConverter { public static byte[] getBytes(short v) { byte[] writeBuffer = new byte[2]; writeBuffer[0] = (byte) ((v >>> 0) & 0xFF); writeBuffer[1] = (byte) ((v >>> 8) & 0xFF); return writeBuffer; }  }
BitConverter { public static byte[] getBytes(short v) { byte[] writeBuffer = new byte[2]; writeBuffer[0] = (byte) ((v >>> 0) & 0xFF); writeBuffer[1] = (byte) ((v >>> 8) & 0xFF); return writeBuffer; }  static byte[] getBytes(short v); static byte[] getBytes(int v); static byte[] getBytes(long v); static byte[] getBytes(float v); static byte[] getBytes(double v); static byte[] getBytes(String v); static String toString(byte[] data, int offset); static float toFloat(byte[] data, int offset); static double toDouble(byte[] data, int offset); static short toInt16(byte[] data, int offset); static int toInt32(byte[] data, int offset); static long toInt64(byte[] data, int offset); static byte[] asByteArray(UUID uuid); static UUID toUUID(byte[] byteArray); static UUID toUUID(byte[] byteArray, int offset); }
BitConverter { public static byte[] getBytes(short v) { byte[] writeBuffer = new byte[2]; writeBuffer[0] = (byte) ((v >>> 0) & 0xFF); writeBuffer[1] = (byte) ((v >>> 8) & 0xFF); return writeBuffer; }  static byte[] getBytes(short v); static byte[] getBytes(int v); static byte[] getBytes(long v); static byte[] getBytes(float v); static byte[] getBytes(double v); static byte[] getBytes(String v); static String toString(byte[] data, int offset); static float toFloat(byte[] data, int offset); static double toDouble(byte[] data, int offset); static short toInt16(byte[] data, int offset); static int toInt32(byte[] data, int offset); static long toInt64(byte[] data, int offset); static byte[] asByteArray(UUID uuid); static UUID toUUID(byte[] byteArray); static UUID toUUID(byte[] byteArray, int offset);  }