ByteUtil { public static byte[] doubleLongToBytes(long value1, long value2) { byte[] output = new byte[16]; longToBytes(value1, output, 0); longToBytes(value2, output, 8); return output; }  static void debugFrame(Logger logger, String message, ByteBuf byteIn); static String formatGroup(String str, int groupSize, int lineBreak); static String maxString(String value, int size); static String bytesToHex(byte[] bytes); static String debugByteArray(byte[] byteArray); static String byteToChar(byte value); static String bytesToHex(byte[] bytes, int groupSize); static String toSimpleString(byte[] bytes); static final byte[] intToBytes(int value); static int bytesToInt(byte[] b); static byte[] longToBytes(long value); static void longToBytes(long x, byte[] output, int offset); static byte[] doubleLongToBytes(long value1, long value2); static byte[] hexToBytes(String hexStr); static String readLine(ActiveMQBuffer buffer); static long convertTextBytes(final String text); static boolean equals(final byte[] left, final byte[] right); static boolean equals(final byte[] left,
                                final byte[] right,
                                final int rightOffset,
                                final int rightLength); static boolean equals(final byte[] bytes, final ByteBuf byteBuf, final int offset, final int length); static int intFromBytes(byte b1, byte b2, byte b3, byte b4); static void zeros(final ByteBuffer buffer); static void zeros(final ByteBuffer buffer, int offset, int bytes); static String getHumanReadableByteCount(long bytes); static final String NON_ASCII_STRING; }
@Test public void testDoubleLongToBytes() { long randomLong1 = RandomUtil.randomLong(); long randomLong2 = RandomUtil.randomLong(); ByteBuffer buffer = ByteBuffer.allocate(16); buffer.putLong(randomLong1); buffer.putLong(randomLong2); byte[] assertContent = buffer.array(); byte[] convertedContent = ByteUtil.doubleLongToBytes(randomLong1, randomLong2); assertArrayEquals(assertContent, convertedContent); }