aboutsummaryrefslogtreecommitdiff
path: root/Emby.Server.Implementations/IO/SharpCifs/Util/Sharpen/OutputStream.cs
diff options
context:
space:
mode:
authorJoshua M. Boniface <joshua@boniface.me>2019-01-07 00:47:06 -0500
committerGitHub <noreply@github.com>2019-01-07 00:47:06 -0500
commitc986340c02cb0b7fe06569d25a1b5d1c8375f7f6 (patch)
tree4971c970bbdb797cc5b3da2d8bae506231b173a5 /Emby.Server.Implementations/IO/SharpCifs/Util/Sharpen/OutputStream.cs
parent76b647e0a8eddd65dc9c4de7b887a3faf6e12bcc (diff)
parent0b804629b85498370c882f5562dfc7acd84bfd11 (diff)
Merge pull request #419 from jellyfin/dev
Master 10.0.0
Diffstat (limited to 'Emby.Server.Implementations/IO/SharpCifs/Util/Sharpen/OutputStream.cs')
-rw-r--r--Emby.Server.Implementations/IO/SharpCifs/Util/Sharpen/OutputStream.cs86
1 files changed, 0 insertions, 86 deletions
diff --git a/Emby.Server.Implementations/IO/SharpCifs/Util/Sharpen/OutputStream.cs b/Emby.Server.Implementations/IO/SharpCifs/Util/Sharpen/OutputStream.cs
deleted file mode 100644
index 0e6189f0c..000000000
--- a/Emby.Server.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]);
- }
- }
- }
- }
- }
-}