mirror of
https://github.com/adamhathcock/sharpcompress.git
synced 2026-02-04 05:25:00 +00:00
another fix
This commit is contained in:
@@ -80,19 +80,12 @@ public class ZipFactory
|
||||
var startPosition = stream.CanSeek ? stream.Position : -1;
|
||||
|
||||
// probe for single volume zip
|
||||
|
||||
if (stream is not SharpCompressStream) // wrap to provide buffer bef
|
||||
{
|
||||
stream = new SharpCompressStream(stream, bufferSize: Constants.BufferSize);
|
||||
}
|
||||
|
||||
if (await ZipArchive.IsZipFileAsync(stream, password, cancellationToken))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
// probe for a multipart zip
|
||||
|
||||
if (!stream.CanSeek)
|
||||
{
|
||||
return false;
|
||||
|
||||
@@ -10,7 +10,6 @@ internal partial class RewindableStream : Stream
|
||||
private bool isRewound;
|
||||
private bool isDisposed;
|
||||
private long streamPosition;
|
||||
private bool _hasStoppedRecording;
|
||||
|
||||
public RewindableStream(Stream stream) => this.stream = stream;
|
||||
|
||||
@@ -47,7 +46,6 @@ internal partial class RewindableStream : Stream
|
||||
"StopRecording can only be called when recording is active."
|
||||
);
|
||||
}
|
||||
_hasStoppedRecording = true;
|
||||
isRewound = true;
|
||||
IsRecording = false;
|
||||
bufferStream.Position = 0;
|
||||
@@ -74,12 +72,6 @@ internal partial class RewindableStream : Stream
|
||||
"StartRecording can only be called when not already recording."
|
||||
);
|
||||
}
|
||||
if (_hasStoppedRecording)
|
||||
{
|
||||
throw new InvalidOperationException(
|
||||
"StartRecording cannot be called after StopRecording has been called."
|
||||
);
|
||||
}
|
||||
//if (isRewound && bufferStream.Position != 0)
|
||||
// throw new System.NotImplementedException();
|
||||
if (bufferStream.Position != 0)
|
||||
|
||||
Reference in New Issue
Block a user