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

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

Description

bytes Int

License

Apache License

Declaration

public static int bytes2Int(byte[] b, int start, int len) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

public class Main {
    public static int bytes2Int(byte[] b, int start, int len) {
        int sum = 0;
        int end = start + len;
        for (int i = start; i < end; i++) {
            int n = (int) b[i] & 0xff;
            n <<= (--len) * 8;/*from   ww  w  .ja va 2  s. c om*/
            sum = n + sum;
        }
        return sum;
    }
}

Related

  1. byte2intArray(byte[] b)
  2. bytes2int(byte value1, byte value2)
  3. bytes2Int(byte... bytes)
  4. bytes2int(byte[] ary)
  5. bytes2int(byte[] b)
  6. bytes2int(byte[] buf)
  7. bytes2int(byte[] bytes)
  8. bytes2Int(byte[] bytes)
  9. bytes2int(byte[] bytes)