Ejemplo n.º 1
0
 public void TestFileCreationAndDeletion()
 {
     var wd = new CaptureFileWriterDevice(@"abc.pcap");
     wd.Write(new byte[] {1, 2, 3, 4});
     wd.Close();
     System.IO.File.Delete(@"abc.pcap");
 }
Ejemplo n.º 2
0
        private static void WritePacketWrappers(string path, List<PacketWrapper> parsedPackets)
        {
            var writer = new CaptureFileWriterDevice(path, FileMode.CreateNew);
            writer.Open();

            foreach (var p in parsedPackets.SelectMany(pw => pw.GetWriteableCaptures()))
                writer.Write(p);

            writer.Close();
        }