private static void TestFrame(byte[] packedData, int outBufferSize, int frameNum, string expectedConcat, string datamsg) { byte[] result = new byte[outBufferSize]; OverlayData.TestUnpack(packedData, result, frameNum * outBufferSize, outBufferSize, false); Assert.AreEqual(expectedConcat, FormatNonZeroBytes(result), "LittleEndianWords Frame {0} of {1}", frameNum, datamsg); // you should get the exact same frame data (scanning horizontally from top left to bottom right) if you had packed data in little endian or big endian byte[] swappedPackedData = SwapBytes(packedData); result = new byte[outBufferSize]; OverlayData.TestUnpack(swappedPackedData, result, frameNum * outBufferSize, outBufferSize, true); Assert.AreEqual(expectedConcat, FormatNonZeroBytes(result), "BigEndianWords Frame {0} of {1}", frameNum, datamsg); }