mirror of
https://github.com/adamhathcock/sharpcompress.git
synced 2026-09-22 15:04:43 +00:00
fix and fmt
This commit is contained in:
@@ -32,18 +32,22 @@ public class RarArchive : AbstractArchive<RarArchiveEntry, RarVolume>
|
||||
{
|
||||
sourceStream.LoadAllParts(); //request all streams
|
||||
var streams = sourceStream.Streams.ToArray();
|
||||
var i = 0;
|
||||
if (streams.Length > 1 && IsRarFile(streams[1], ReaderOptions)) //test part 2 - true = multipart not split
|
||||
{
|
||||
sourceStream.IsVolumes = true;
|
||||
streams[1].Position = 0;
|
||||
sourceStream.Position = 0;
|
||||
|
||||
return sourceStream.Streams.Select(a => new StreamRarArchiveVolume(a, ReaderOptions, 0));
|
||||
}
|
||||
else //split mode or single file
|
||||
{
|
||||
return new StreamRarArchiveVolume(sourceStream, ReaderOptions, 0).AsEnumerable();
|
||||
return sourceStream.Streams.Select(a => new StreamRarArchiveVolume(
|
||||
a,
|
||||
ReaderOptions,
|
||||
i++
|
||||
));
|
||||
}
|
||||
|
||||
//split mode or single file
|
||||
return new StreamRarArchiveVolume(sourceStream, ReaderOptions, i++).AsEnumerable();
|
||||
}
|
||||
|
||||
protected override IReader CreateReaderForSolidExtraction()
|
||||
|
||||
@@ -4,5 +4,8 @@ namespace SharpCompress.Test;
|
||||
|
||||
public static class OperatingSystemExtensions
|
||||
{
|
||||
public static bool IsWindows(this OperatingSystem os) => os.Platform == PlatformID.Win32NT || os.Platform == PlatformID.Win32Windows || os.Platform == PlatformID.Win32S;
|
||||
public static bool IsWindows(this OperatingSystem os) =>
|
||||
os.Platform == PlatformID.Win32NT
|
||||
|| os.Platform == PlatformID.Win32Windows
|
||||
|| os.Platform == PlatformID.Win32S;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user