コード例 #1
0
        void WritePathTable(BinaryWriter writer, PathTable table)
        {
            Assert.IsNotNull(writer, nameof(writer));
            Assert.IsNotNull(table, nameof(table));

            foreach (var item in table.Items)
            {
                writer.Write((Byte)item.Name.Length);
                writer.Write((Byte)0);
                writer.Write(table.Endian == Endian.BigEndian ? BinaryIO.ChangeEndian(item.Sector) : item.Sector);
                writer.Write(table.Endian == Endian.BigEndian ? BinaryIO.ChangeEndian(item.ParentIndex) : item.ParentIndex);
                writer.Write(Encodings.ASCII.GetBytes(item.Name));

                if (item.Name.Length % 2 == 1)
                {
                    writer.Write((Byte)0);
                }
            }
        }