Java Byte Array to Int byteToInteger(byte[] b)

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

Description

byte To Integer

License

Open Source License

Declaration

public static int byteToInteger(byte[] b) 

Method Source Code

//package com.java2s;

public class Main {
    public static int byteToInteger(byte[] b) {
        int i = 0;
        i += b[0] & 0xFF;//from ww w. ja  v  a  2 s .  c o m
        i += b[1] << 8;
        i += b[2] << 16;
        i += b[3] << 24;

        return i;
    }
}

Related

  1. byteToInt(byte[] num)
  2. byteToInt(byte[] source, int sourceOffset)
  3. byteToInt(byte[] values)
  4. byteToInt(final byte[] b)
  5. byteToInt2(byte[] b)