Example #1
0
        public static Gdat Create(Stream output)
        {
            Gdat gdat = new Gdat(new KaitaiStream(output));

            gdat._files = new List <File>();
            return(gdat);
        }
Example #2
0
        public static Gdat Create(Stream input, Stream output)
        {
            Gdat inputGdat = Gdat.FromStream(input);

            inputGdat.ReadData();
            Gdat outputGdat = Gdat.Create(output);

            foreach (var file in inputGdat.Files)
            {
                Console.WriteLine("Adding file");
                File outputFile = new File(outputGdat.m_io);
                outputFile.FileLength = file.FileLength;
                outputFile.FileOffset = file.FileOffset;
                outputFile.Body       = file.Body;
                outputGdat.Files.Add(outputFile);
            }
            return(outputGdat);
        }
Example #3
0
 public File(KaitaiStream p__io, Gdat p__parent = null, Gdat p__root = null) : base(p__io)
 {
     m_parent = p__parent;
     m_root   = p__root;
     f_body   = false;
 }
Example #4
0
 public Gdat(KaitaiStream p__io, KaitaiStruct p__parent = null, Gdat p__root = null) : base(p__io)
 {
     m_parent = p__parent;
     m_root   = p__root ?? this;
 }
Example #5
0
 public void SetParent(Gdat gdat)
 {
     m_root   = gdat;
     m_parent = gdat;
 }
Example #6
0
 public static void ToStream(Gdat data, Stream output)
 {
     data.Write(output);
 }
Example #7
0
 public static FileStream ToFile(Gdat data, string filename)
 {
     data.Write(filename);
     return((FileStream)data.m_io.BaseStream);
 }