TextReader.cs 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. //
  2. // System.IO.TextWriter
  3. //
  4. // Author: Marcin Szczepanski ([email protected])
  5. //
  6. // TODO: Implement the Thread Safe stuff
  7. //
  8. using System;
  9. namespace System.IO {
  10. public abstract class TextReader : MarshalByRefObject, IDisposable {
  11. protected TextReader() { }
  12. public static readonly TextReader Null;
  13. public virtual void Close() {
  14. Dispose(true);
  15. }
  16. void System.IDisposable.Dispose() {
  17. Dispose(true);
  18. }
  19. protected virtual void Dispose( bool disposing ) {
  20. return;
  21. }
  22. public virtual int Peek() {
  23. return -1;
  24. }
  25. public virtual int Read() {
  26. return -1;
  27. }
  28. // LAMESPEC: The Beta2 docs say this should be Read( out char[] ...
  29. // whereas the MS implementation is just Read( char[] ... )
  30. // Not sure which one is right, we'll see in Beta3 :)
  31. public virtual int Read( char[] buffer, int index, int count ) {
  32. return 1;
  33. }
  34. public virtual int ReadBlock( char[] buffer, int index, int count ) {
  35. return 1;
  36. }
  37. public virtual string ReadLine() {
  38. return String.Empty;
  39. }
  40. public virtual string ReadToEnd() {
  41. return String.Empty;
  42. }
  43. public static TextReader Synchronised( TextReader reader ) {
  44. // TODO: Implement
  45. return Null;
  46. }
  47. }
  48. }