Java Byte to Little Endian byteToIntBigend(byte[] bytes)

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

Description

byte To Int Bigend

License

Apache License

Declaration

public static int byteToIntBigend(byte[] bytes) 

Method Source Code

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

public class Main {
    public static int byteToIntBigend(byte[] bytes) {
        int length = 4;
        int intValue = 0;
        for (int i = 0; i < length; i++) {
            int offset = (length - i - 1) * 8;
            intValue |= (bytes[i] & 0xFF) << offset;
        }/*  www.j a va 2s  . c  o  m*/
        return intValue;
    }
}