**** Merged from MCS ****
[mono-project.git] / mcs / class / Microsoft.Web.Services / Microsoft.Web.Services.Dime / DimeReader.cs
blob9e39d7406a3bc31fe0daa66891fe98a745add3aa
1 //
2 // Microsoft.Web.Services.Dime.DimeReader.cs
3 //
4 // Name: Duncan Mak (duncan@ximian.com)
5 //
6 // Copyright (C) Ximian, Inc. 2003
7 //
9 using System;
10 using System.IO;
12 namespace Microsoft.Web.Services.Dime {
14 public class DimeReader
17 Stream stream;
18 bool opened;
20 public DimeReader (Stream stream)
22 if (stream == null)
23 throw new ArgumentNullException (
24 Locale.GetText ("Argument is null."));
26 if (stream.CanRead == false)
27 throw new ArgumentException (
28 Locale.GetText ("The stream is not readable"));
30 this.stream = stream;
31 opened = true;
34 public void Close ()
36 if (opened == false)
37 throw new InvalidOperationException (
38 Locale.GetText ("The stream is currently open."));
40 stream.Close ();
41 opened = false;
44 public bool CanRead {
45 get { return stream.CanRead; }
48 [MonoTODO]
49 public DimeRecord ReadRecord ()
51 if (opened == false)
52 throw new InvalidOperationException (
53 Locale.GetText ("The stream is currently closed."));
54 opened = true;
56 throw new NotImplementedException ();