BitMiracle.LibTiff.Classic.Tiff.swab64BitData C# (CSharp) Method

swab64BitData() private static method

private static swab64BitData ( byte buffer, int offset, int count ) : void
buffer byte
offset int
count int
return void
        private static void swab64BitData(byte[] buffer, int offset, int count)
        {
            Debug.Assert((count & 7) == 0);

            int doubleCount = count / 8;
            double[] doubles = new double[doubleCount];
            int byteOffset = offset;
            for (int i = 0; i < doubleCount; i++)
            {
                doubles[i] = BitConverter.ToDouble(buffer, byteOffset);
                byteOffset += 8;
            }

            SwabArrayOfDouble(doubles, doubleCount);

            byteOffset = offset;
            for (int i = 0; i < doubleCount; i++)
            {
                byte[] bytes = BitConverter.GetBytes(doubles[i]);
                Buffer.BlockCopy(bytes, 0, buffer, byteOffset, bytes.Length);
                byteOffset += bytes.Length;
            }
        }
Tiff