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

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

Description

bytes To Integer

License

Open Source License

Declaration

public static int bytesToInteger(byte[] bytes) 

Method Source Code

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

public class Main {
    public static int bytesToInteger(byte[] bytes) {
        return (bytes[0] << 24) & 0xff000000 | (bytes[1] << 16) & 0x00ff0000 | (bytes[2] << 8) & 0x0000ff00
                | (bytes[3]) & 0x000000ff;
    }//from   w  w  w . j a v a2  s  .  c om
}

Related

  1. bytesToInt16(byte highByte, byte lowByte)
  2. bytesToInt2(byte[] arr, int offset)
  3. bytesToIntArr(byte[] arr, int offset, int[] num, int soff, int size)
  4. bytesToInteger(byte[] b)
  5. bytesToInteger(byte[] b, int off)
  6. bytesToInts(byte[] a, int ao, int[] b, int bo, int len)
  7. bytesToInts(byte[] bytes, int shift, int[] spec)
  8. bytesToInts(byte[] data)
  9. bytesToInts(byte[][] bytes)