Example #1
0
        public override bool Read(BinaryReader br)
        {
            long currentAddress = br.BaseStream.Position;
            int  dummy          = br.ReadInt32();

            if (dummy != 1)
            {
                // If found a different value, please tell me to study the possibilities
                throw new InvalidDataException("Unexpected data reading Text chunk; expected 0x00000001, but found " + dummy.ToString("X8"));
            }
            int bytesUsed = br.ReadInt32();

            text = CText.ReadP4bAsciiString(br);
            // Consume padding bytes, just in case
            br.BaseStream.Seek(currentAddress + bytesUsed + 8, SeekOrigin.Begin);
            return(true);
        }