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

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

Description

bytes To Int

Declaration

public static int bytesToInt(byte[] b) 

Method Source Code

//package com.java2s;

public class Main {

    public static int bytesToInt(byte[] b) {
        int n = (int) ((((b[3] & 0xff) << 24) | ((b[2] & 0xff) << 16)
                | ((b[1] & 0xff) << 8) | ((b[0] & 0xff) << 0)));
        return n;
    }/*from  www  .j a  v  a 2  s  . c  om*/
}

Related

  1. byte2Integer(byte[] bin)
  2. byteArrayToInt(byte[] b)
  3. byteArrayToInt(byte[] b)
  4. byteArrayToInt(byte[] bytes)
  5. bytes2Int(byte[] data)
  6. bytesToInt(byte[] bytes)
  7. bytesToInt(byte[] bytes)
  8. bytesToInt(byte[] in)
  9. bytesLE2int(byte[] b, int off)