示例#1
0
 public void WriteRecord(bool binary, byte[] mrecord)
 {
     if (stored && last != -1)
     {
         f.Seek(-1, SeekOrigin.Current);
     }
     stored = false;
     TapeConverter.ToTape(binary, mrecord, out byte[] trecord);
     recpos.Push(f.Position);
     trecord[0] |= 0x80;          /* add record marker */
     f.Write(trecord, 0, trecord.Length);
     if (f.Position != f.Length)  /* not at end of file? */
     {
         f.SetLength(f.Position); /* cut remaining parts */
     }
 }
示例#2
0
文件: Tools.cs 项目: rhobbie/Sim704
 public void WriteRecord(bool binary, byte[] mrecord)
 {
     if (stored && last != -1)           /* first byte of record already read ? */
     {
         f.Seek(-1, SeekOrigin.Current); /* go back to start of record */
     }
     stored = false;
     TapeConverter.ToTape(binary, mrecord, out byte[] trecord); /* convert to tape format, generate parity */
     recpos.Push(f.Position);                                   /* store startpos of record on stack */
     trecord[0] |= 0x80;                                        /* add record marker */
     f.Write(trecord, 0, trecord.Length);
     if (f.Position != f.Length)                                /* currently not at end of the tape-file? */
     {
         f.SetLength(f.Position);                               /* cut remaining parts of the file */
     }
 }