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

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

Introduction

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

Prototype

public static void writeSwappedLong(byte[] data, int offset, long value) 

Source Link

Document

Writes a "long" value to a byte array at a given offset.

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;
}