System.Classes.TStream.ReadData
Delphi
function ReadData( Buffer: Pointer; Count: NativeInt): NativeInt; overload; inline;
function ReadData(const Buffer: TBytes; Count: NativeInt): NativeInt; overload; inline;
function ReadData(var Buffer: Boolean): NativeInt; overload; inline;
function ReadData(var Buffer: Boolean; Count: NativeInt): NativeInt; overload;
function ReadData(var Buffer: AnsiChar): NativeInt; overload; inline;
function ReadData(var Buffer: AnsiChar; Count: NativeInt): NativeInt; overload;
function ReadData(var Buffer: Char): NativeInt; overload; inline;
function ReadData(var Buffer: Char; Count: NativeInt): NativeInt; overload;
function ReadData(var Buffer: Int8): NativeInt; overload; inline;
function ReadData(var Buffer: Int8; Count: NativeInt): NativeInt; overload;
function ReadData(var Buffer: UInt8): NativeInt; overload; inline;
function ReadData(var Buffer: UInt8; Count: NativeInt): NativeInt; overload;
function ReadData(var Buffer: Int16): NativeInt; overload; inline;
function ReadData(var Buffer: Int16; Count: NativeInt): NativeInt; overload;
function ReadData(var Buffer: UInt16): NativeInt; overload; inline;
function ReadData(var Buffer: UInt16; Count: NativeInt): NativeInt; overload;
function ReadData(var Buffer: Int32): NativeInt; overload; inline;
function ReadData(var Buffer: Int32; Count: NativeInt): NativeInt; overload;
function ReadData(var Buffer: UInt32): NativeInt; overload; inline;
function ReadData(var Buffer: UInt32; Count: NativeInt): NativeInt; overload;
function ReadData(var Buffer: Int64): NativeInt; overload; inline;
function ReadData(var Buffer: Int64; Count: NativeInt): NativeInt; overload;
function ReadData(var Buffer: UInt64): NativeInt; overload; inline;
function ReadData(var Buffer: UInt64; Count: NativeInt): NativeInt; overload;
function ReadData(var Buffer: Single): NativeInt; overload; inline;
function ReadData(var Buffer: Single; Count: NativeInt): NativeInt; overload;
function ReadData(var Buffer: Double): NativeInt; overload; inline;
function ReadData(var Buffer: Double; Count: NativeInt): NativeInt; overload;
function ReadData(var Buffer: Extended): NativeInt; overload; inline;
function ReadData(var Buffer: Extended; Count: NativeInt): NativeInt; overload;
function ReadData(var Buffer: TExtended80Rec): NativeInt; overload; inline;
function ReadData(var Buffer: TExtended80Rec; Count: NativeInt): NativeInt; overload;
function ReadData<T>(var Buffer: T): NativeInt; overload; inline;
function ReadData<T>(var Buffer: T; Count: NativeInt): NativeInt; overload;
C++
System::NativeInt __fastcall ReadData(void * Buffer, System::NativeInt Count)/* overload */;
System::NativeInt __fastcall ReadData(const System::Sysutils::TBytes Buffer, System::NativeInt Count)/* overload */;
System::NativeInt __fastcall ReadData(bool &Buffer)/* overload */;
System::NativeInt __fastcall ReadData(bool &Buffer, System::NativeInt Count)/* overload */;
System::NativeInt __fastcall ReadData(char &Buffer)/* overload */;
System::NativeInt __fastcall ReadData(char &Buffer, System::NativeInt Count)/* overload */;
System::NativeInt __fastcall ReadData(System::WideChar &Buffer)/* overload */;
System::NativeInt __fastcall ReadData(System::WideChar &Buffer, System::NativeInt Count)/* overload */;
System::NativeInt __fastcall ReadData(System::Int8 &Buffer)/* overload */;
System::NativeInt __fastcall ReadData(System::Int8 &Buffer, System::NativeInt Count)/* overload */;
System::NativeInt __fastcall ReadData(System::UInt8 &Buffer)/* overload */;
System::NativeInt __fastcall ReadData(System::UInt8 &Buffer, System::NativeInt Count)/* overload */;
System::NativeInt __fastcall ReadData(System::Int16 &Buffer)/* overload */;
System::NativeInt __fastcall ReadData(System::Int16 &Buffer, System::NativeInt Count)/* overload */;
System::NativeInt __fastcall ReadData(System::UInt16 &Buffer)/* overload */;
System::NativeInt __fastcall ReadData(System::UInt16 &Buffer, System::NativeInt Count)/* overload */;
System::NativeInt __fastcall ReadData(System::Int32 &Buffer)/* overload */;
System::NativeInt __fastcall ReadData(System::Int32 &Buffer, System::NativeInt Count)/* overload */;
System::NativeInt __fastcall ReadData(System::UInt32 &Buffer)/* overload */;
System::NativeInt __fastcall ReadData(System::UInt32 &Buffer, System::NativeInt Count)/* overload */;
System::NativeInt __fastcall ReadData(__int64 &Buffer)/* overload */;
System::NativeInt __fastcall ReadData(__int64 &Buffer, System::NativeInt Count)/* overload */;
System::NativeInt __fastcall ReadData(unsigned __int64 &Buffer)/* overload */;
System::NativeInt __fastcall ReadData(unsigned __int64 &Buffer, System::NativeInt Count)/* overload */;
System::NativeInt __fastcall ReadData(float &Buffer)/* overload */;
System::NativeInt __fastcall ReadData(float &Buffer, System::NativeInt Count)/* overload */;
System::NativeInt __fastcall ReadData(double &Buffer)/* overload */;
System::NativeInt __fastcall ReadData(double &Buffer, System::NativeInt Count)/* overload */;
System::NativeInt __fastcall ReadData(System::Extended &Buffer)/* overload */;
System::NativeInt __fastcall ReadData(System::Extended &Buffer, System::NativeInt Count)/* overload */;
System::NativeInt __fastcall ReadData(System::TExtended80Rec &Buffer)/* overload */;
System::NativeInt __fastcall ReadData(System::TExtended80Rec &Buffer, System::NativeInt Count)/* overload */;
template<typename T> System::NativeInt __fastcall ReadData(T &Buffer)/* overload */;
template<typename T> System::NativeInt __fastcall ReadData(T &Buffer, System::NativeInt Count)/* overload */;
Eigenschaften
| Typ | Sichtbarkeit | Quelle | Unit | Übergeordnet |
|---|---|---|---|---|
| function | public | System.Classes.pas System.Classes.hpp |
System.Classes | TStream |
Beschreibung
Methoden, die für das Einlesen von bis zu Count, aber nicht mehr als SizeOf(Buffer) Byte aus dem Stream in Buffer zuständig sind.
ReadData wird für Fälle verwendet, bei denen die Anzahl der aus dem Stream zu lesenden Bytes nicht notwendigerweise festgelegt sein muss.
ReadData arbeitet mit den folgenden Algorithmen:
- Wenn ReadData den Parameter
Countnicht enthält, dann versucht ReadData, die Byte-AnzahlSizeOf(Buffer)zu lesen und setzt dann die aktuelle Position im Stream um die Anzahl der übertragenen Bytes nach vorne. ReadData gibt die Anzahl der gelesenen Bytes zurück. - Wenn ReadData den Parameter
Countenthält, dann:- Versucht ReadData die Byte-Anzahl
SizeOf(Buffer)zu lesen, wennCount> SizeOf(Buffer). ReadData setzt die aktuelle Position im Stream umCountByte nach vorne. ReadData gibtCountzurück. - Versucht ReadData bis zu
CountByte aus dem Stream zu lesen, wennCount<= SizeOf(Buffer). ReadData setzt die aktuelle Position im Stream um die Anzahl der übertragenen Bytes nach vorne. ReadData gibt die Anzahl der gelesenen Bytes zurück.
- Versucht ReadData die Byte-Anzahl
ReadData-Methoden rufen zum Ausführen des eigentlichen Lesevorgangs Read auf.