FlatBuffers.ByteBuffer.WriteLittleEndian C# (CSharp) Method

WriteLittleEndian() protected method

protected WriteLittleEndian ( int offset, int count, ulong data ) : void
offset int
count int
data ulong
return void
        protected void WriteLittleEndian(int offset, int count, ulong data)
        {
            if (BitConverter.IsLittleEndian)
            {
                for (int i = 0; i < count; i++)
                {
                    _buffer[offset + i] = (byte)(data >> i * 8);
                }
            }
            else
            {
                for (int i = 0; i < count; i++)
                {
                    _buffer[offset + count - 1 - i] = (byte)(data >> i * 8);
                }
            }
        }