Java Byte Array to Int Bytes2Int32(byte[] sour, int offset)

Here you can find the source of Bytes2Int32(byte[] sour, int offset)

Description

Bytes Int

License

Open Source License

Declaration

public static int Bytes2Int32(byte[] sour, int offset) 

Method Source Code

//package com.java2s;

public class Main {

    public static int Bytes2Int32(byte[] sour, int offset) {
        return (((sour[offset] << 24) & 0xFF000000) | ((sour[offset + 1] << 16) & 0x00FF0000)
                | ((sour[offset + 2] << 8) & 0x0000FF00) | (sour[offset + 3] & 0x000000FF));
    }// w  w w.  j a v a 2  s  . c o m
}

Related

  1. bytes2int(byte[] bytes, int offset, boolean bigEndian)
  2. bytes2int(byte[] in, int index1, int index2, int index3)
  3. bytes2int(byte[] src)
  4. bytes2Int(byte[] src, int start)
  5. Bytes2Int16(byte[] sour, int offset)
  6. Bytes2Int64(byte[] sour, int offset)
  7. bytes2IntArray(byte[] bytes)
  8. bytes2Integer(byte[] byteVal)
  9. bytes2LengthToIntLowOrder(byte[] intBytes)