2013-04-07 10:58:58 +01:00
|
|
|
|
using System.IO;
|
|
|
|
|
|
using SharpCompress.Common.Rar;
|
|
|
|
|
|
using SharpCompress.Common.Rar.Headers;
|
|
|
|
|
|
|
|
|
|
|
|
namespace SharpCompress.Archive.Rar
|
|
|
|
|
|
{
|
|
|
|
|
|
internal class FileInfoRarFilePart : RarFilePart
|
|
|
|
|
|
{
|
|
|
|
|
|
private FileInfoRarArchiveVolume volume;
|
|
|
|
|
|
|
|
|
|
|
|
internal FileInfoRarFilePart(FileInfoRarArchiveVolume volume, MarkHeader mh, FileHeader fh, FileInfo fi)
|
|
|
|
|
|
: base(mh, fh)
|
|
|
|
|
|
{
|
|
|
|
|
|
this.volume = volume;
|
|
|
|
|
|
FileInfo = fi;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2013-04-28 12:32:55 +01:00
|
|
|
|
internal FileInfo FileInfo { get; private set; }
|
2013-04-07 10:58:58 +01:00
|
|
|
|
|
2013-04-28 11:07:13 +01:00
|
|
|
|
internal override Stream GetCompressedStream()
|
2013-04-07 10:58:58 +01:00
|
|
|
|
{
|
|
|
|
|
|
var stream = volume.Stream;
|
|
|
|
|
|
stream.Position = FileHeader.DataStartPosition;
|
|
|
|
|
|
return stream;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
internal override string FilePartName
|
|
|
|
|
|
{
|
|
|
|
|
|
get
|
|
|
|
|
|
{
|
|
|
|
|
|
return "Rar File: " + FileInfo.FullName
|
2013-04-28 12:32:55 +01:00
|
|
|
|
+ " File Entry: " + FileHeader.FileName;
|
2013-04-07 10:58:58 +01:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2013-04-28 12:32:55 +01:00
|
|
|
|
}
|