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

            gdat._files = new List <File>();
            return(gdat);
        }
示例#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);
        }
示例#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;
 }
示例#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;
 }
示例#5
0
 public void SetParent(Gdat gdat)
 {
     m_root   = gdat;
     m_parent = gdat;
 }
示例#6
0
 public static void ToStream(Gdat data, Stream output)
 {
     data.Write(output);
 }
示例#7
0
 public static FileStream ToFile(Gdat data, string filename)
 {
     data.Write(filename);
     return((FileStream)data.m_io.BaseStream);
 }