예제 #1
0
        public override TagHeader Clone()
        {
            HeaderV2 h = new HeaderV2();

            h.byte0        = byte0;
            h.byte1        = byte1;
            h.byte2        = byte2;
            h.versionMajor = versionMajor;
            h.versionMinor = versionMinor;
            h.flags        = flags;
            h.size         = size;

            return(h);
        }
예제 #2
0
        private static void TestHeaderV2()
        {
            HeaderV2 header = new HeaderV2();

            header.IgnoreUnsupportedFlags = true;

            byte[] data =
            {
                // File identificator
                (byte)'I', (byte)'D', (byte)'3',

                // Version
                3,                 0,

                // Flags
                0xE0,

                // Size
                0,                 0,         0, 0
            };

            using (Reader reader = new Reader(data))
            {
                header.Read(reader);
                header.CheckVersion(Version.v2_3);
            }

            UnitTest.Test(header.HeaderSize == 10);
            UnitTest.Test(header.VersionMajor == 3);
            UnitTest.Test(header.VersionMinor == 0);
            UnitTest.Test(header.IsUnsynchronized);
            UnitTest.Test(header.HasExtendedHeader);
            UnitTest.Test(header.HasExperimentalStage);

            using (Writer writer = new Writer())
            {
                header.Write(writer);
                UnitTest.Test(ArrayUtils.IsEqual(writer.OutData, data));
            }
        }