public Entry() { this.typeCodeField = EntryTypeCodes.COMP; this.contextConductionIndField = true; }
private static void SaveAsmFile(BinaryWriter w, string filename, string fileText, EntryTypeCodes type, bool extended) { if (extended) { // Need to calculate size of data var stream = new MemoryStream(); using (BinaryWriter tempBuffer = new BinaryWriter(stream)) { tempBuffer.Write(filename); tempBuffer.Write(fileText ?? string.Empty); tempBuffer.Flush(); var bytes = stream.GetBuffer(); var len = (int)stream.Length; w.Write(len); w.Write((byte)type); w.Write(bytes, 0, (int)len); } } else { w.Write((byte)type); w.Write(filename); w.Write(fileText ?? string.Empty); } }