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

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

Introduction

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

Prototype

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

Source Link

Document

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

Usage

From source file:ch.threema.apitool.messages.ImageMessage.java

@Override
public byte[] getData() {
    byte[] data = new byte[BLOB_ID_LEN + 4 + NaCl.NONCEBYTES];
    int pos = 0;/*w w w  . jav a  2 s  .c  o  m*/
    System.arraycopy(this.blobId, 0, data, pos, BLOB_ID_LEN);
    pos += BLOB_ID_LEN;

    EndianUtils.writeSwappedInteger(data, pos, this.size);
    pos += 4;

    System.arraycopy(this.nonce, 0, data, pos, NaCl.NONCEBYTES);
    return data;

}