Java Byte Array to Int byteToInt(byte[] bytes)

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

Description

byte To Int

License

Open Source License

Declaration

public static int byteToInt(byte[] bytes) 

Method Source Code

//package com.java2s;

public class Main {

    public static int byteToInt(byte[] bytes) {
        int num = 0;
        int temp;
        temp = (0x000000ff & (bytes[0])) << 0;
        num = num | temp;/*w  w  w  . ja  va 2  s  . c o  m*/
        temp = (0x000000ff & (bytes[1])) << 8;
        num = num | temp;
        temp = (0x000000ff & (bytes[2])) << 16;
        num = num | temp;
        temp = (0x000000ff & (bytes[3])) << 24;
        num = num | temp;
        return num;
    }
}

Related

  1. byteToInt(byte[] b)
  2. byteToInt(byte[] b)
  3. byteToInt(byte[] bank)
  4. byteToInt(byte[] buf, int off)
  5. byteToInt(byte[] byteArray)
  6. byteToInt(byte[] i_Value)
  7. byteToInt(byte[] num)
  8. byteToInt(byte[] source, int sourceOffset)
  9. byteToInt(byte[] values)