Android Byte Array to Int Convert getInt2(byte[] b, int offset)

Here you can find the source of getInt2(byte[] b, int offset)

Description

get Int

Declaration

public static int getInt2(byte[] b, int offset) 

Method Source Code

//package com.java2s;

public class Main {

    public static int getInt2(byte[] b, int offset) {
        return ((b[offset] & 0xff) << 8) | (b[offset + 1] & 0xff);
    }/*from w w w .j a v a  2s.c  om*/
}

Related

  1. getInt(byte[] buf, boolean bigEndian)
  2. getInt(byte[] buf, int pos, boolean bigEndian)
  3. getInt(byte[] buffer, int pos, int count)
  4. getInt(byte[] bytes)
  5. getInt(int offset, byte[] fromBytes)
  6. getInt3(byte[] b, int offset)
  7. getIntFrom2ByteArray(final byte[] input)
  8. getIntFromByte(final byte bite)
  9. getIntFromByte(final byte bite)