diff --git a/Aaru.Helpers/IO/ForcedSeekStream.cs b/Aaru.Helpers/IO/ForcedSeekStream.cs index 79eed470e..377e236b0 100644 --- a/Aaru.Helpers/IO/ForcedSeekStream.cs +++ b/Aaru.Helpers/IO/ForcedSeekStream.cs @@ -59,6 +59,19 @@ public sealed class ForcedSeekStream : Stream where T : Stream CalculateLength(); } + /// Initializes a new instance of the class. + /// A pre-created stream instance. + /// + 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(); + } + /// Initializes a new instance of the class. /// The real (uncompressed) length of the stream. /// Parameters that are used to create the base stream.