Beispiel #1
0
        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
            });
        }
Beispiel #2
0
        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
            });
        }