4 public class BinaryWrTest
{
5 public static int Main () {
6 MemoryStream mr
= new MemoryStream();
7 BinaryWriter wr
= new BinaryWriter(mr
);
13 byte [] arr
= mr
.ToArray();
15 Console
.Write ("Array (should be: 1 1 0 0 0 ff ff ff ff): ");
17 for (int a
= 0; a
!= arr
.Length
; a
++)
18 Console
.Write(arr
[a
].ToString("x") + " ");
28 if (arr
[1] != 1 && arr
[2] != 0 && arr
[3] != 0 && arr
[4] != 0)
31 if (arr
[5] != 0xff && arr
[6] != 0xff && arr
[7] != 0xff && arr
[8] != 0xff)
34 Console
.WriteLine("test-ok");