Java examples for Internationalization:Charset
to Little 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(toLittleEndianWord(value))); }/* w w w . j a va 2s. com*/ public static byte[] toLittleEndianWord(final long value) { return new byte[] { (byte) (value & 0xFF), (byte) ((value & 0xFF00L) >>> 8) }; } }