Ejemplo n.º 1
0
 public Entry()
 {
     this.typeCodeField = EntryTypeCodes.COMP;
     this.contextConductionIndField = true;
 }
Ejemplo n.º 2
0
        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);
            }
        }