PipedOutputStream.cs 558 B

12345678910111213141516171819202122232425262728293031323334353637
  1. namespace SharpCifs.Util.Sharpen
  2. {
  3. internal class PipedOutputStream : OutputStream
  4. {
  5. PipedInputStream _ips;
  6. public PipedOutputStream ()
  7. {
  8. }
  9. public PipedOutputStream (PipedInputStream iss) : this()
  10. {
  11. Attach (iss);
  12. }
  13. public override void Close ()
  14. {
  15. _ips.Close ();
  16. base.Close ();
  17. }
  18. internal void Attach (PipedInputStream iss)
  19. {
  20. _ips = iss;
  21. }
  22. public override void Write (int b)
  23. {
  24. _ips.Write (b);
  25. }
  26. public override void Write (byte[] b, int offset, int len)
  27. {
  28. _ips.Write (b, offset, len);
  29. }
  30. }
  31. }