Class WimFileEntry

Class WimFileEntry

Namespace: Aspose.Zip.Wim
Assembly: Aspose.Zip.dll (25.1.0)

wim 아카이브 내의 단일 파일을 나타냅니다.

public sealed class WimFileEntry : WimEntry, IArchiveFileEntry

상속

objectWimEntryWimFileEntry

구현

IArchiveFileEntry

상속된 멤버

WimEntry.ToString(), WimEntry.Archive, WimEntry.Image, WimEntry.Parent, WimEntry.Name, WimEntry.ShortName, WimEntry.FullPath, WimEntry.ChangeTime, WimEntry.CreationTime, WimEntry.LastAccessTime, WimEntry.LastWriteTime, WimEntry.FileAttributes, WimEntry.AlternateDataStreams, WimEntry.HardLink, WimEntry.HasHardLinks, WimEntry.IsDirectory, object.GetType(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()

속성

Length

항목의 바이트 길이를 가져옵니다.

public long Length { get; }

속성 값

long

메서드

Extract(string)

제공된 경로에 따라 파일 시스템에 항목을 추출합니다.

public FileInfo Extract(string path)

매개변수

path string

대상 파일의 경로입니다. 파일이 이미 존재하는 경우 덮어씌워집니다.

반환

FileInfo

구성된 파일의 파일 정보입니다.

예제

using (var archive = new WimArchive("archive.wim"))
{
    archive.Images[0].RootDirectory.Files[0].Extract("data.bin");
}

예외

ArgumentNullException

path가 null입니다.

SecurityException

호출자가 접근할 수 있는 권한이 없습니다.

ArgumentException

path가 비어 있거나, 공백만 포함하거나, 유효하지 않은 문자를 포함합니다.

UnauthorizedAccessException

path에 대한 파일 접근이 거부되었습니다.

PathTooLongException

지정된 path, 파일 이름 또는 둘 다 시스템에서 정의한 최대 길이를 초과합니다. 예를 들어, Windows 기반 플랫폼에서는 경로가 248자 미만이어야 하며, 파일 이름은 260자 미만이어야 합니다.

NotSupportedException

path에 문자열 중간에 콜론(:)이 포함되어 있습니다.

FileNotFoundException

파일을 찾을 수 없습니다.

DirectoryNotFoundException

지정된 경로가 유효하지 않습니다(예: 매핑되지 않은 드라이브에 있음).

IOException

파일이 이미 열려 있습니다.

InvalidDataException

아카이브가 손상되었습니다.

Extract(Stream)

제공된 스트림으로 항목을 추출합니다.

public void Extract(Stream destination)

매개변수

destination Stream

대상 스트림. 쓰기가 가능해야 합니다.

예제

wim 아카이브의 항목을 추출합니다.

using (var archive = new WimArchive("archive.wim"))
{
    archive.Images[0].RootDirectory.Files[0].Extract(httpResponseStream);
}

예외

ArgumentException

destination가 쓰기를 지원하지 않습니다.

InvalidDataException

아카이브가 손상되었습니다.

Open()

추출을 위해 항목을 열고 항목 내용이 포함된 스트림을 제공합니다.

public Stream Open()

반환

Stream

항목의 내용을 나타내는 스트림입니다.

예제

사용법: 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>

#### 비고

스트림에서 읽어 원본 파일의 내용을 가져옵니다. 예제 섹션을 참조하세요.
 한국어