public static DAIEbx ReadFromFile(String Filename) { FileStream file = new FileStream(Filename, FileMode.Open); DAIEbx ebx = new DAIEbx(); ebx.Serialize(file); file.Close(); return(ebx); }
public static void ExtractEbxGuidAndType(MemoryStream EbxBuffer, out string type, out string guid) { DAIEbx EbxFile = new DAIEbx(); EbxFile.Serialize(EbxBuffer); guid = ""; for (int i = 0; i < EbxFile.FileGuid.Length; i++) { guid += EbxFile.FileGuid[i].ToString("X2"); } type = EbxFile.RootInstance.Descriptor.FieldName; }
public static byte[] ExtractEbx(MemoryStream EbxBuffer) { MemoryStream OutputStream = new MemoryStream(); DAIEbx EbxFile = new DAIEbx(); EbxFile.Serialize(EbxBuffer); StreamWriter Writer = new StreamWriter(OutputStream); Writer.Write(EbxFile.ToXml()); Writer.Close(); return(OutputStream.ToArray()); }