Exemplo n.º 1
0
 public PacketLogWriter(Stream stream, bool ownsStream, LogHeader header)
 {
     _stream     = stream;
     _ownsStream = ownsStream;
     BlockHelper.WriteBlock(_stream, BlockType.MagicBytes,
                            new ArraySegment <byte>(LogHelper.Encoding.GetBytes(LogHelper.MagicBytes)));
     BlockHelper.WriteBlock(_stream, BlockType.Region,
                            new ArraySegment <byte>(Encoding.UTF8.GetBytes(header.Region)));
     BlockHelper.WriteBlock(_stream, BlockType.Start, new ArraySegment <byte>(new byte[0]));
 }
Exemplo n.º 2
0
 public PacketLogWriter(string filename, LogHeader header)
     : this(new FileStream(filename, FileMode.CreateNew, FileAccess.Write, FileShare.Read), true, header)
 {
 }
Exemplo n.º 3
0
 internal PacketLogReader(Stream stream)
 {
     _stream = stream;
     Header  = new LogHeader();
     ReadHeader();
 }