Java examples for Internationalization:Charset
to Big Endian Word
//package com.java2s; public class Main { public static void main(String[] argv) throws Exception { long value = 2; System.out.println(java.util.Arrays .toString(toBigEndianWord(value))); }/* w ww . j a va 2 s. c o m*/ public static byte[] toBigEndianWord(final long value) { return new byte[] { (byte) ((value & 0xFF00L) >>> 8), (byte) (value & 0xFF) }; } }