mirror of
https://github.com/aaru-dps/Aaru.git
synced 2025-12-16 19:24:25 +00:00
REFACTOR: Final cleanup of DiscImageChef.Filters.
This commit is contained in:
@@ -38,13 +38,13 @@ using Microsoft.Win32.SafeHandles;
|
||||
namespace DiscImageChef.Filters
|
||||
{
|
||||
/// <summary>
|
||||
/// Creates a stream that is a subset of another stream.
|
||||
/// Creates a stream that is a subset of another stream.
|
||||
/// </summary>
|
||||
public class OffsetStream : Stream
|
||||
{
|
||||
readonly Stream baseStream;
|
||||
readonly long streamStart;
|
||||
readonly long streamEnd;
|
||||
readonly long streamStart;
|
||||
|
||||
public OffsetStream(Stream stream, long start, long end)
|
||||
{
|
||||
@@ -291,12 +291,6 @@ namespace DiscImageChef.Filters
|
||||
if(end > baseStream.Length) throw new ArgumentOutOfRangeException(nameof(end), "End is after stream end.");
|
||||
}
|
||||
|
||||
~OffsetStream()
|
||||
{
|
||||
baseStream.Close();
|
||||
baseStream.Dispose();
|
||||
}
|
||||
|
||||
public override bool CanRead => baseStream.CanRead;
|
||||
|
||||
public override bool CanSeek => baseStream.CanSeek;
|
||||
@@ -317,6 +311,12 @@ namespace DiscImageChef.Filters
|
||||
}
|
||||
}
|
||||
|
||||
~OffsetStream()
|
||||
{
|
||||
baseStream.Close();
|
||||
baseStream.Dispose();
|
||||
}
|
||||
|
||||
public override IAsyncResult BeginRead(byte[] buffer, int offset, int count, AsyncCallback callback,
|
||||
object state)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user