public PcapNGWriter(Stream stream, bool reverseByteOrder = false) { CustomContract.Requires <ArgumentNullException>(stream != null, "stream cannot be null"); HeaderWithInterfacesDescriptions header = HeaderWithInterfacesDescriptions.CreateEmptyHeadeWithInterfacesDescriptions(false); Initialize(stream, new List <HeaderWithInterfacesDescriptions>() { header }); }
public PcapNGWriter(string path, bool reverseByteOrder = false) { CustomContract.Requires <ArgumentNullException>(!string.IsNullOrWhiteSpace(path), "path cannot be null or empty"); CustomContract.Requires <ArgumentException>(!File.Exists(path), "file exists"); HeaderWithInterfacesDescriptions header = HeaderWithInterfacesDescriptions.CreateEmptyHeadeWithInterfacesDescriptions(false); Initialize(new FileStream(path, FileMode.Create), new List <HeaderWithInterfacesDescriptions>() { header }); }