diff options
| author | Luke Pulverenti <luke.pulverenti@gmail.com> | 2017-08-16 02:43:41 -0400 |
|---|---|---|
| committer | Luke Pulverenti <luke.pulverenti@gmail.com> | 2017-08-16 02:43:41 -0400 |
| commit | bfcd1b520fd79b893e721ba916ae5e1656407d2f (patch) | |
| tree | 6a05119800484435fb384da25c6390054a27c3c3 /Emby.Common.Implementations/IO/SharpCifs/Util/Sharpen/OutputStream.cs | |
| parent | e3531534b85aeaaa3e4aaf462d5e77ea142dc762 (diff) | |
merge common implementations and server implementations
Diffstat (limited to 'Emby.Common.Implementations/IO/SharpCifs/Util/Sharpen/OutputStream.cs')
| -rw-r--r-- | Emby.Common.Implementations/IO/SharpCifs/Util/Sharpen/OutputStream.cs | 86 |
1 files changed, 0 insertions, 86 deletions
diff --git a/Emby.Common.Implementations/IO/SharpCifs/Util/Sharpen/OutputStream.cs b/Emby.Common.Implementations/IO/SharpCifs/Util/Sharpen/OutputStream.cs deleted file mode 100644 index 0e6189f0c..000000000 --- a/Emby.Common.Implementations/IO/SharpCifs/Util/Sharpen/OutputStream.cs +++ /dev/null @@ -1,86 +0,0 @@ -using System; -using System.IO; - -namespace SharpCifs.Util.Sharpen -{ - public class OutputStream : IDisposable - { - protected Stream Wrapped; - - public static implicit operator OutputStream (Stream s) - { - return Wrap (s); - } - - public static implicit operator Stream (OutputStream s) - { - return s.GetWrappedStream (); - } - - public virtual void Close () - { - if (Wrapped != null) { - //Stream.`Close` method deleted - //Wrapped.Close (); - Wrapped.Dispose(); - } - } - - public void Dispose () - { - Close (); - } - - public virtual void Flush () - { - if (Wrapped != null) { - Wrapped.Flush (); - } - } - - internal Stream GetWrappedStream () - { - // Always create a wrapper stream (not directly Wrapped) since the subclass - // may be overriding methods that need to be called when used through the Stream class - return new WrappedSystemStream (this); - } - - static internal OutputStream Wrap (Stream s) - { - OutputStream stream = new OutputStream (); - stream.Wrapped = s; - return stream; - } - - public virtual void Write (int b) - { - if (Wrapped is WrappedSystemStream) - ((WrappedSystemStream)Wrapped).OutputStream.Write (b); - else { - if (Wrapped == null) - throw new NotImplementedException (); - Wrapped.WriteByte ((byte)b); - } - } - - public virtual void Write (byte[] b) - { - Write (b, 0, b.Length); - } - - public virtual void Write (byte[] b, int offset, int len) - { - if (Wrapped is WrappedSystemStream) - ((WrappedSystemStream)Wrapped).OutputStream.Write (b, offset, len); - else { - if (Wrapped != null) { - Wrapped.Write (b, offset, len); - } else { - for (int i = 0; i < len; i++) { - Write (b[i + offset]); - } - } - } - } - } -} |
