DemoCommon.BinaryTable.WriteIntArray C# (CSharp) Method

WriteIntArray() private static method

private static WriteIntArray ( FileStream fs, int vals ) : void
fs System.IO.FileStream
vals int
return void
        private static unsafe void WriteIntArray(FileStream fs, int[] vals)
        {
            int count = vals.Length;
            WriteInt(fs, count);
            byte[] data = new byte[count * sizeof(int)];
            fixed (byte* pData = data) {
                int* ptr = (int*)pData;
                for (int i = 0; i < count; ++i) {
                    *ptr = vals[i];
                    ptr++;
                }
            }
            fs.Write(data, 0, count * sizeof(int));
        }