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"); }
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(); }