Android Byte Array to Short Convert bytes2short(byte[] data)

Here you can find the source of bytes2short(byte[] data)

Description

bytesshort

Declaration

public static short bytes2short(byte[] data) 

Method Source Code

//package com.java2s;

public class Main {
    public static short bytes2short(byte[] data) {
        short val = 0;

        val |= data[0] & 0x00FF;
        val |= data[1] << 8;

        return val;
    }/*w ww  . j  a v  a2 s .  com*/
}

Related

  1. getShort(byte[] bytes)
  2. toShort(byte[] b, int pos)
  3. toShort(byte[] data)
  4. toShort(byte[] data)
  5. makeShort(byte b1, byte b0)
  6. ByteToString(byte[] byteArray)