Android Byte Array to Int Convert getInt(int offset, byte[] fromBytes)

Here you can find the source of getInt(int offset, byte[] fromBytes)

Description

get Int

License

Open Source License

Declaration

public static int getInt(int offset, byte[] fromBytes) 

Method Source Code

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

public class Main {
    public static int getInt(int offset, byte[] fromBytes) {
        final int toInt;

        toInt = ((0xff & fromBytes[offset + 0]) << 24)
                | ((0xff & fromBytes[offset + 1]) << 16)
                | ((0xff & fromBytes[offset + 2]) << 8)
                | ((0xff & fromBytes[offset + 3]) << 0);

        return toInt;
    }/*  w ww . j  av  a2s. c  o  m*/
}

Related

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