mirror of
https://github.com/aaru-dps/Aaru.git
synced 2026-07-08 17:56:18 +00:00
Add constructor to ForcedSeekStream for initializing with a pre-created stream
This commit is contained in:
@@ -59,6 +59,19 @@ public sealed class ForcedSeekStream<T> : Stream where T : Stream
|
|||||||
CalculateLength();
|
CalculateLength();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>Initializes a new instance of the <see cref="T:Aaru.Helpers.IO.ForcedSeekStream`1" /> class.</summary>
|
||||||
|
/// <param name="stream">A pre-created stream instance.</param>
|
||||||
|
/// <inheritdoc />
|
||||||
|
public ForcedSeekStream(long length, T stream)
|
||||||
|
{
|
||||||
|
_streamLength = length;
|
||||||
|
_baseStream = stream;
|
||||||
|
_backFile = Path.GetTempFileName();
|
||||||
|
_backStream = new FileStream(_backFile, FileMode.Open, FileAccess.ReadWrite, FileShare.None);
|
||||||
|
|
||||||
|
if(length == 0) CalculateLength();
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>Initializes a new instance of the <see cref="T:Aaru.Helpers.IO.ForcedSeekStream`1" /> class.</summary>
|
/// <summary>Initializes a new instance of the <see cref="T:Aaru.Helpers.IO.ForcedSeekStream`1" /> class.</summary>
|
||||||
/// <param name="length">The real (uncompressed) length of the stream.</param>
|
/// <param name="length">The real (uncompressed) length of the stream.</param>
|
||||||
/// <param name="args">Parameters that are used to create the base stream.</param>
|
/// <param name="args">Parameters that are used to create the base stream.</param>
|
||||||
|
|||||||
Reference in New Issue
Block a user