| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384 |
- //
- // System.IO.TextReader
- //
- // Author: Marcin Szczepanski ([email protected])
- //
- // TODO: Implement the Thread Safe stuff
- //
- using System;
- namespace System.IO {
- [MonoTODO]
- public abstract class TextReader : MarshalByRefObject, IDisposable {
-
- protected TextReader() { }
-
- public static readonly TextReader Null;
-
- public virtual void Close()
- {
- Dispose(true);
- }
- void System.IDisposable.Dispose()
- {
- Dispose(true);
- }
- protected virtual void Dispose( bool disposing )
- {
- return;
- }
-
- public virtual int Peek()
- {
- return -1;
- }
-
- public virtual int Read()
- {
- return -1;
- }
-
- // LAMESPEC: The Beta2 docs say this should be Read( out char[] ...
- // whereas the MS implementation is just Read( char[] ... )
- // Not sure which one is right, we'll see in Beta3 :)
- public virtual int Read (char[] buffer, int index, int count)
- {
- int c, i;
-
- for (i = 0; i < count; i++) {
- if ((c = Read ()) == -1)
- return i;
- buffer [index + i] = (char)c;
- }
-
- return i;
- }
-
- public virtual int ReadBlock( char[] buffer, int index, int count )
- {
- return 0;
- }
- public virtual string ReadLine()
- {
- return String.Empty;
- }
- public virtual string ReadToEnd()
- {
- return String.Empty;
- }
- [MonoTODO]
- public static TextReader Synchronised( TextReader reader )
- {
- // TODO: Implement
- return Null;
- }
- }
- }
|