WriteBinary() public method

Write an array of bytes to the stream as an Erlang binary.
public WriteBinary ( byte bin ) : void
bin byte The array of bytes to write.
return void
        public void Write_Binary()
        {
            var r = new Random();
            byte[] rnd = new byte[65536];
            r.NextBytes(rnd);

            byte[] want = BuildBinBuffer(rnd);
            byte[] got;
            using (var os = new OtpOutputStream())
            {
                os.WriteBinary(rnd);
                Assert.AreEqual(want.Length, os.Position);
                got = os.ToArray();
            }

            CollectionAssert.AreEqual(want, got);
        }