Java Byte Array to Int bytes2Int(byte[] src, int start)

Here you can find the source of bytes2Int(byte[] src, int start)

Description

bytes Int

License

Open Source License

Declaration

public static int bytes2Int(byte[] src, int start) 

Method Source Code

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

public class Main {
    public static int bytes2Int(byte[] src, int start) {
        int a = src[start];
        int b = src[start + 1];
        int c = src[start + 2];
        int d = src[start + 3];
        return (d << 24) | (c << 16) | (b << 8) | a;
    }//from w w w  . j  a  va  2s  .  co m
}

Related

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