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