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 + 1] << 8) | b[index + 0] & 0xff));
    }/* w  w w  .j av  a  2  s  .  co  m*/
}

Related

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