base/common/src/main/com/thesett/common/util/ByteBufferUtils.java
public static short getShortFromBytes(byte[] buf, int offset)
    {
        short result = 0;

        result += buf[offset++] & 0xFF;
        result += ((buf[offset]) << 8);

        return result;
    }
public static short getShortFromBytes(byte[] buf, int offset)
    {
        short result = 0;

        result += buf[offset++] & 0xFF;
        result += ((buf[offset]) << 8);

        return result;
    }
public static short getShortFromBytes ( byte [ ] buf , int offset ) { short result = 0 ; result += buf [ offset ++ ] & 0xFF ; result += ( ( buf [ offset ] ) << 8 ) ; return result ; }
Extracts a short from an array of bytes.

@param  buf    The array of bytes to extract the short from.
@param  offset The offset of the start of the short in the byte array.

@return A short extracted from the 2 bytes of data.
Extracts a short from an array of bytes .