Example #1
0
            private void _read()
            {
                _magic = m_io.ReadBytes(2);
                if (!((KaitaiStream.ByteArrayCompare(Magic, new byte[] { 80, 75 }) == 0)))
                {
                    throw new ValidationNotEqualError(new byte[] { 80, 75 }, Magic, M_Io, "/types/pk_section/seq/0");
                }
                _sectionType = m_io.ReadU2le();
                switch (SectionType)
                {
                case 513: {
                    _body = new CentralDirEntry(m_io, this, m_root);
                    break;
                }

                case 1027: {
                    _body = new LocalFile(m_io, this, m_root);
                    break;
                }

                case 1541: {
                    _body = new EndOfCentralDir(m_io, this, m_root);
                    break;
                }

                case 2055: {
                    _body = new DataDescriptor(m_io, this, m_root);
                    break;
                }
                }
            }
            private void _read()
            {
                _magic       = m_io.EnsureFixedContents(new byte[] { 80, 75 });
                _sectionType = m_io.ReadU2le();
                switch (SectionType)
                {
                case 513: {
                    _body = new CentralDirEntry(m_io, this, m_root);
                    break;
                }

                case 1027: {
                    _body = new LocalFile(m_io, this, m_root);
                    break;
                }

                case 1541: {
                    _body = new EndOfCentralDir(m_io, this, m_root);
                    break;
                }
                }
            }