2013-04-07 10:58:58 +01:00
|
|
|
|
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, Options options)
|
|
|
|
|
|
: base(options)
|
|
|
|
|
|
{
|
|
|
|
|
|
this.stream = stream;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
internal override void ValidateArchive(RarVolume archive)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (archive.IsMultiVolume)
|
|
|
|
|
|
{
|
2013-04-28 12:32:55 +01:00
|
|
|
|
throw new MultiVolumeExtractionException(
|
|
|
|
|
|
"Streamed archive is a Multi-volume archive. Use different RarReader method to extract.");
|
2013-04-07 10:58:58 +01:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
internal override Stream RequestInitialStream()
|
|
|
|
|
|
{
|
|
|
|
|
|
return stream;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2013-04-28 12:32:55 +01:00
|
|
|
|
}
|