public void T18_Random_BER_Buffered_IO() { X690.Node x, y; var buffer = new byte[8192]; for (var iterations = 0; iterations < 16; iterations++) { x = TT.RandomBranch(8, 8, 8, LengthEncoding.Random); var length = x.Write(buffer, 0); Console.WriteLine(length); y = X690.Read(buffer, 0, length); Assert.Equal(x, y); } }
public void T17_Random_BER_Stream_IO() { X690.Node x, y; for (var iterations = 0; iterations < 16; iterations++) { using (var stream = new MemoryStream()) { x = TT.RandomBranch(8, 8, 8, LengthEncoding.Random); x.Write(stream); stream.Position = 0; y = X690.Read(stream); } Assert.Equal(x, y); } }