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

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

Introduction

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

Prototype

public static long swapLong(long value) 

Source Link

Document

Converts a "long" value between endian systems.

Usage

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

private static byte[] getLongAsByteArray(long intervalNum) {
    byte[] time2 = new byte[8];
    long swapped = EndianUtils.swapLong(intervalNum);
    EndianUtils.writeSwappedLong(time2, 0, swapped);
    return time2;
}