Esempio n. 1
0
        private StructInstance GetChunkInstance(BinaryReader reader, StructElement chunkDef, int chunkSize, StructInstance parent)
        {
            StructInstance inst = null;

            if (chunkDef != null)
            {
                int size = chunkDef.Size;
                if (size != 0)
                {
                    inst = chunkDef.Parse(parent, reader.BaseStream, reader.BaseStream.Position + chunkSize) as StructInstance;
                }
                else
                {
                    inst = chunkDef.Parse(parent, null, 0) as StructInstance;
                }
            }

            return inst;
        }
Esempio n. 2
0
        private StructInstance GetAtomInstance(BinaryReader reader, StructElement atomDef, uint atomSize, StructInstance parent)
        {
            StructInstance inst = null;

            if (atomDef != null)
            {
                int size = atomDef.Size;
                if (size != 0)
                {
                    inst = atomDef.Parse(parent, reader.BaseStream, reader.BaseStream.Position + atomSize - 8) as StructInstance;
                }
                else
                {
                    inst = atomDef.Parse(parent, null, 0) as StructInstance;
                }
            }

            return inst;
        }