Class XarFileEntry
名称: Aspose.Zip.Xar 組み合わせ: Aspose.Zip.dll (25.5.0)
ファイルエントリーを xar アーカイブに表示します。
public sealed class XarFileEntry : XarEntry, IArchiveFileEntry
Inheritance
object ← XarEntry ← XarFileEntry
Implements
相続人
XarEntry.ToString() , XarEntry.Name , XarEntry.FullPath , XarEntry.IsDirectory , XarEntry.Parent , XarEntry.CreationTime , XarEntry.LastAccessTime , XarEntry.LastWriteTime , XarEntry.ModificationTime , object.GetType() , object.ToString() , object.Equals(object?) , object.Equals(object?, object?) , object.ReferenceEquals(object?, object?) , object.GetHashCode()
Properties
Length
バイトで入力の長さを取得します。
public long Length { get; }
不動産価値
Methods
Extract(ストレッチ)
ファイルシステムへの入り口を提供されたルートで抽出します。
public FileInfo Extract(string path)
Parameters
path
string
ターゲットファイルへのルート. ファイルが既に存在している場合、それは過剰に書かれます。
Returns
コンポーネントファイルの情報
Examples
using (var archive = new XarArchive("archive.xar"))
{
((XarFileEntry)archive.Entries[0]).Extract("data.bin");
}
Exceptions
path’ is null.
通話者には、必要なアクセス許可はありません。
path’ は空っぽで、白いスペースのみが含まれ、または無効な文字が含まれています。
path" ファイルへのアクセスは拒否されます。
指定された path’, ファイル名, または両方ともシステム定義の最大長さを超えています. たとえば、Windows ベースのプラットフォームでは、パスは 248 文字未満で、ファイル名は 260 文字未満でなければなりません。
path’ のファイルには、列の真ん中のコロン(:)が含まれています。
アーカイブが腐敗した。
Extract(Stream)
提供された流れへの入り口を抽出します。
public void Extract(Stream destination)
Parameters
destination
Stream
目的地の流れは、書くべきです。
Examples
サー・アーカイブのエントリーを抽出します。
using (var archive = new XarArchive("archive.xar"))
{
((XarFileEntry)archive.Entries[0]).Extract(httpResponseStream);
}
Exceptions
destination’ does not support writing.
アーカイブが腐敗した。
Open()
抽出のためのエントリーを開き、エントリーコンテンツの流れを提供します。
public Stream Open()
Returns
入力の内容を表す流れ。
Examples
使用:Stream decompressed = entry.Open();
.NET 4.0 またはそれ以上 - Stream.CopyTo 方法を使用する:decompressed.CopyTo(httpResponse.OutputStream)
.NET 3.5 および以前 - バイトを手動でコピーする:
byte[] buffer = new byte[8192];
int bytesRead;
while (0 < (bytesRead = decompressed.Read(buffer, 0, buffer.Length)))
fileStream.Write(buffer, 0, bytesRead);
```</p>
#### Remarks
Read from the stream to get the original content of a file. See examples section.
### <a id="Aspose_Zip_Xar_XarFileEntry_CompressionProgressed"></a> CompressionProgressed
Raises when a portion of raw stream compressed.
```csharp
public event EventHandler<progresseventargs> CompressionProgressed
イベントタイプ
EventHandler < ProgressEventArgs >
Examples
archive.Entries.First().CompressionProgressed += (s, e) => { int percent = (int)((100 * (long)e.ProceededBytes) / entrySourceStream.Length); };
Remarks
イベント送信は Aspose.Zip.Xar.XarFileEntry 例です。