System.Zip.TZipFile.Read
Delphi
procedure Read(const FileName: string; out Bytes: TBytes); overload;
procedure Read(Index: Integer; out Bytes: TBytes); overload;
procedure Read(const FileName: string; out Stream: TStream; out LocalHeader: TZipHeader; CheckCrc: Boolean = False); overload;
procedure Read(Index: Integer; out Stream: TStream; out LocalHeader: TZipHeader; CheckCrc: Boolean = False); overload;
C++
void __fastcall Read(const System::UnicodeString FileName, /* out */ System::Sysutils::TBytes &Bytes)/* overload */;
void __fastcall Read(int Index, /* out */ System::Sysutils::TBytes &Bytes)/* overload */;
void __fastcall Read(const System::UnicodeString FileName, /* out */ System::Classes::TStream* &Stream, /* out */ TZipHeader &LocalHeader, bool CheckCrc = false)/* overload */;
void __fastcall Read(int Index, /* out */ System::Classes::TStream* &Stream, /* out */ TZipHeader &LocalHeader, bool CheckCrc = false)/* overload */;
Properties
Type | Visibility | Source | Unit | Parent |
---|---|---|---|---|
procedure function |
public | System.Zip.pas System.Zip.hpp |
System.Zip | TZipFile |
Description
Reads a file from a .zip archive.
There are four overloads of this procedure, depending on the file representation and the output mode.
FileName
indicates the name of the file in the .zip archive.
Bytes
represents the output bytes (used by the first two overloads).
Index
is the index of the file in this .zip archive.
Stream
is the output stream (used by the last two overloads).
LocalHeader
is the local file header.
The overload procedures that take an integer as a parameter are useful when the .zip archive contains duplicate file names.
To track the progress of the operation, use OnProgress.