Example usage for org.apache.commons.io EndianUtils swapInteger

List of usage examples for org.apache.commons.io EndianUtils swapInteger

Introduction

In this page you can find the example usage for org.apache.commons.io EndianUtils swapInteger.

Prototype

public static int swapInteger(int value) 

Source Link

Document

Converts a "int" value between endian systems.

Usage

From source file:com.github.bmadecoder.Authenticator.java

private static int selectInt(byte input[]) {
    int i = selectPos(input);
    byte[] subarray = ArrayUtils.subarray(input, i, i + 4);
    subarray[0] = (byte) (subarray[0] & 0x7f);
    int readSwappedInteger = EndianUtils.readSwappedInteger(subarray, 0);
    int result = EndianUtils.swapInteger(readSwappedInteger);
    return result;
}