2010-02-19 Rodrigo Kumpera <rkumpera@novell.com>
[mono.git] / mono / tests / stream.cs
blobd3314381c00091ae965642534e7a78f7228d0892
1 using System;
2 using System.IO;
4 public class Test {
6 public static int Main () {
7 byte[] buf = new byte [20];
8 int i;
9 FileStream s = new FileStream ("stest.dat", FileMode.OpenOrCreate, FileAccess.ReadWrite);
10 for (i=0; i < 20; ++i)
11 buf [i] = 65;
12 s.Write (buf, 0, 20);
13 s.Position = 0;
14 for (i=0; i < 20; ++i)
15 buf [i] = 66;
16 s.Read (buf, 0, 20);
17 for (i=0; i < 20; ++i)
18 if (buf [i] != 65)
19 return 1;
21 return 0;