From ee2d6216b7507ec32b1859dc1cd5587bfe572a1d Mon Sep 17 00:00:00 2001 From: Adam Hathcock Date: Wed, 14 Aug 2013 16:36:09 +0100 Subject: [PATCH] Remove unused class --- .../LZMA/Utilites/UnpackSubStream.cs | 96 ------------------- SharpCompress/SharpCompress.Portable.csproj | 1 - .../SharpCompress.WindowsStore.csproj | 1 - 3 files changed, 98 deletions(-) delete mode 100644 SharpCompress/Compressor/LZMA/Utilites/UnpackSubStream.cs diff --git a/SharpCompress/Compressor/LZMA/Utilites/UnpackSubStream.cs b/SharpCompress/Compressor/LZMA/Utilites/UnpackSubStream.cs deleted file mode 100644 index 67547dcf..00000000 --- a/SharpCompress/Compressor/LZMA/Utilites/UnpackSubStream.cs +++ /dev/null @@ -1,96 +0,0 @@ - -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Text; - -namespace master._7zip.Utilities -{ - /// - /// This stream is a length-constrained wrapper around a cached stream so it does not dispose the inner stream. - /// - internal class UnpackSubStream: Stream - { - private Stream mSource; - private long mLength; - private long mOffset; - - internal UnpackSubStream(Stream source, long length) - { - mSource = source; - mLength = length; - } - - public override bool CanRead - { - get { return mSource.CanRead; } - } - - public override bool CanSeek - { - get { return false; } - } - - public override bool CanWrite - { - get { return false; } - } - - public override void Flush() - { - throw new NotSupportedException(); - } - - public override long Length - { - get { return mLength; } - } - - public override long Position - { - get { return mOffset; } - set { throw new NotSupportedException(); } - } - - public override int Read(byte[] buffer, int offset, int count) - { - if(buffer == null) - throw new ArgumentNullException("buffer"); - - if(offset < 0 || offset > buffer.Length) - throw new ArgumentOutOfRangeException("offset"); - - if(count < 0 || count > buffer.Length - offset) - throw new ArgumentOutOfRangeException("count"); - - if(count > mLength - mOffset) - count = (int)(mLength - mOffset); - - if(count == 0) - return 0; - - int processed = mSource.Read(buffer, offset, count); - if(processed == 0) - throw new EndOfStreamException("Decoded stream ended prematurely, unpacked data is corrupt."); - - mOffset += processed; - return processed; - } - - public override long Seek(long offset, SeekOrigin origin) - { - throw new NotSupportedException(); - } - - public override void SetLength(long value) - { - throw new NotSupportedException(); - } - - public override void Write(byte[] buffer, int offset, int count) - { - throw new NotSupportedException(); - } - } -} diff --git a/SharpCompress/SharpCompress.Portable.csproj b/SharpCompress/SharpCompress.Portable.csproj index 479f9ec6..6a0644d1 100644 --- a/SharpCompress/SharpCompress.Portable.csproj +++ b/SharpCompress/SharpCompress.Portable.csproj @@ -204,7 +204,6 @@ - diff --git a/SharpCompress/SharpCompress.WindowsStore.csproj b/SharpCompress/SharpCompress.WindowsStore.csproj index 7de253c3..a220a041 100644 --- a/SharpCompress/SharpCompress.WindowsStore.csproj +++ b/SharpCompress/SharpCompress.WindowsStore.csproj @@ -194,7 +194,6 @@ -