Android Byte Array to Int Convert getShort(byte[] data)

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

Description

get Short

License

Open Source License

Declaration

private static int getShort(byte[] data) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

public class Main {
    private static int getShort(byte[] data) {
        return (int) ((data[0] << 8) | data[1] & 0xFF);
    }/*w w w  .j  ava2  s.c om*/
}

Related

  1. toIntegerArray(byte[] input, int offset, int len, int[] output, int outputOffset)
  2. toInt(byte[] bytes)
  3. toInteger(byte[] input)
  4. toInteger(byte[] input, int offset)
  5. readInt(byte[] buff, int pos)
  6. getUnsignedSafe(byte[] buffer, int pos)
  7. toUInt16(byte[] bytes, int start)
  8. intToOctet(byte[] buf, int i)
  9. readInt(byte[] byteArray, int offset)