Here you can find the source of flipEndian(byte[] data)
Parameter | Description |
---|---|
data | Byte array to flip |
public static byte[] flipEndian(byte[] data)
//package com.java2s; //License from project: Open Source License public class Main { /**/*from w w w . j ava2s . c om*/ * Reverse the endian-ness of a byte array. * * @param data Byte array to flip * @return Flipped array */ public static byte[] flipEndian(byte[] data) { if (data == null) { return new byte[0]; } byte[] newData = new byte[data.length]; for (int i = 0; i < data.length; i++) { newData[data.length - i - 1] = data[i]; } return newData; } }