Here you can find the source of bytesToShortLittleEndian(final byte[] vals, final int from)
bytes
into single short
Parameter | Description |
---|---|
vals | raw data |
from | offset in array |
public static int bytesToShortLittleEndian(final byte[] vals, final int from)
//package com.java2s; public class Main { /**/*from w w w . jav a 2 s.c om*/ * <code>bytes</code> into single <code>short</code> * @param vals raw data * @param from offset in array * @return int */ public static int bytesToShortLittleEndian(final byte[] vals, final int from) { return ((vals[from + 1] & 0xFF) << 8) + (vals[from] & 0xFF); } }