Android Byte Array to Int Convert bytesToInt(byte[] bytes)

Here you can find the source of bytesToInt(byte[] bytes)

Description

bytes To Int

Declaration

public static int bytesToInt(byte[] bytes) 

Method Source Code

//package com.java2s;

public class Main {
    public static int bytesToInt(byte[] bytes) {
        return bytes[3] & 0xFF | (bytes[2] & 0xFF) << 8
                | (bytes[1] & 0xFF) << 16 | (bytes[0] & 0xFF) << 24;
    }/* ww  w . ja  v  a 2 s  . c o m*/
}

Related

  1. BytesToInt(byte[] value)
  2. bytesToInt(byte[] bytes)
  3. bytesToInt(byte[] bytes, int offset)
  4. swap32bitFromArray(byte[] value, int offset)
  5. swap32bitsToArray(int value, byte[] dest, int offset)
  6. swapU16bitFromArray(byte[] value, int offset)