mirror of
https://github.com/adamhathcock/sharpcompress.git
synced 2026-02-13 21:22:22 +00:00
34 lines
924 B
C#
34 lines
924 B
C#
using System.Collections.Generic;
|
|
using System.IO;
|
|
using SharpCompress.Common;
|
|
using SharpCompress.Common.Rar;
|
|
|
|
namespace SharpCompress.Reader.Rar
|
|
{
|
|
internal class SingleVolumeRarReader : RarReader
|
|
{
|
|
|
|
private readonly Stream stream;
|
|
|
|
internal SingleVolumeRarReader(Stream stream, string password, Options options)
|
|
: base(options)
|
|
{
|
|
Password = password;
|
|
this.stream = stream;
|
|
}
|
|
|
|
internal override void ValidateArchive(RarVolume archive)
|
|
{
|
|
if (archive.IsMultiVolume)
|
|
{
|
|
throw new MultiVolumeExtractionException(
|
|
"Streamed archive is a Multi-volume archive. Use different RarReader method to extract.");
|
|
}
|
|
}
|
|
|
|
internal override Stream RequestInitialStream()
|
|
{
|
|
return stream;
|
|
}
|
|
}
|
|
} |