Android Byte Array to Short Convert getShort(byte[] b, int index)

Here you can find the source of getShort(byte[] b, int index)

Description

get Short

Declaration

public static short getShort(byte[] b, int index) 

Method Source Code

//package com.java2s;

public class Main {
    public static short getShort(byte[] b, int index) {
        return (short) (((b[index] << 8) | b[index + 1] & 0xff));
    }/*from   ww  w. java 2s .  c  om*/
}

Related

  1. bytesLE2ushort(byte[] b, int off)
  2. bytesLE2ushorts(byte[] b)
  3. bytesToShort(byte[] b)
  4. bytesToShort(byte[] b)
  5. bytesToShort(byte[] bytes)
  6. getShort(byte[] b, int index)
  7. getShort(byte[] buf, boolean bigEndian)
  8. getShort(byte[] buf, int pos, boolean bigEndian)
  9. getShort(byte[] bytes)