to Little Endian Short - Java Internationalization

Java examples for Internationalization:Big Endian Little Endian

Description

to Little Endian Short

Demo Code


//package com.java2s;

public class Main {
    public static short toLittleEndianShort(byte a, byte b) {
        short retVal;
        retVal = (short) (((b & 0xFF) << 8) | (a & 0xFF));//for little endian
        return retVal;
    }/*from  www.  j ava2 s.  co  m*/
}

Related Tutorials