Android Byte Array to Short Convert toShort(byte[] b, int pos)

Here you can find the source of toShort(byte[] b, int pos)

Description

to Short

Declaration

public static short toShort(byte[] b, int pos) 

Method Source Code

//package com.java2s;

public class Main {

    public static short toShort(byte[] b, int pos) {
        short ret = 0;
        ret |= (b[pos] & 0xFF);/*from  w ww . j  av a  2  s  . c  o  m*/
        ret |= (b[pos + 1] & 0xFF) << 8;
        return ret;
    }
}

Related

  1. getShort(byte[] b, int index)
  2. getShort(byte[] b, int index)
  3. getShort(byte[] buf, boolean bigEndian)
  4. getShort(byte[] buf, int pos, boolean bigEndian)
  5. getShort(byte[] bytes)
  6. toShort(byte[] data)
  7. toShort(byte[] data)
  8. makeShort(byte b1, byte b0)
  9. bytes2short(byte[] data)