System.Classes.TStream.ReadData
Delphi
function ReadData( Buffer: Pointer; Count: NativeInt): NativeInt; overload;
function ReadData(const Buffer: TBytes; Count: NativeInt): NativeInt; overload;
function ReadData(var Buffer: Boolean): NativeInt; overload;
function ReadData(var Buffer: Boolean; Count: NativeInt): NativeInt; overload;
function ReadData(var Buffer: AnsiChar): NativeInt; overload;
function ReadData(var Buffer: AnsiChar; Count: NativeInt): NativeInt; overload;
function ReadData(var Buffer: Char): NativeInt; overload;
function ReadData(var Buffer: Char; Count: NativeInt): NativeInt; overload;
function ReadData(var Buffer: Int8): NativeInt; overload;
function ReadData(var Buffer: Int8; Count: NativeInt): NativeInt; overload;
function ReadData(var Buffer: UInt8): NativeInt; overload;
function ReadData(var Buffer: UInt8; Count: NativeInt): NativeInt; overload;
function ReadData(var Buffer: Int16): NativeInt; overload;
function ReadData(var Buffer: Int16; Count: NativeInt): NativeInt; overload;
function ReadData(var Buffer: UInt16): NativeInt; overload;
function ReadData(var Buffer: UInt16; Count: NativeInt): NativeInt; overload;
function ReadData(var Buffer: Int32): NativeInt; overload;
function ReadData(var Buffer: Int32; Count: NativeInt): NativeInt; overload;
function ReadData(var Buffer: UInt32): NativeInt; overload;
function ReadData(var Buffer: UInt32; Count: NativeInt): NativeInt; overload;
function ReadData(var Buffer: Int64): NativeInt; overload;
function ReadData(var Buffer: Int64; Count: NativeInt): NativeInt; overload;
function ReadData(var Buffer: UInt64): NativeInt; overload;
function ReadData(var Buffer: UInt64; Count: NativeInt): NativeInt; overload;
function ReadData(var Buffer: Single): NativeInt; overload;
function ReadData(var Buffer: Single; Count: NativeInt): NativeInt; overload;
function ReadData(var Buffer: Double): NativeInt; overload;
function ReadData(var Buffer: Double; Count: NativeInt): NativeInt; overload;
function ReadData(var Buffer: Extended): NativeInt; overload;
function ReadData(var Buffer: Extended; Count: NativeInt): NativeInt; overload;
function ReadData(var Buffer: TExtended80Rec): NativeInt; overload;
function ReadData(var Buffer: TExtended80Rec; Count: NativeInt): NativeInt; overload;
function ReadData<T>(var Buffer: T): NativeInt; overload;
function ReadData<T>(var Buffer: T; Count: NativeInt): NativeInt; overload;
C++
NativeInt __fastcall ReadData(void * Buffer, NativeInt Count)/* overload */;
NativeInt __fastcall ReadData(const System::DynamicArray<System::Byte> Buffer, NativeInt Count)/* overload */;
NativeInt __fastcall ReadData(bool &Buffer)/* overload */;
NativeInt __fastcall ReadData(bool &Buffer, NativeInt Count)/* overload */;
NativeInt __fastcall ReadData(char &Buffer)/* overload */;
NativeInt __fastcall ReadData(char &Buffer, NativeInt Count)/* overload */;
NativeInt __fastcall ReadData(System::WideChar &Buffer)/* overload */;
NativeInt __fastcall ReadData(System::WideChar &Buffer, NativeInt Count)/* overload */;
NativeInt __fastcall ReadData(System::Int8 &Buffer)/* overload */;
NativeInt __fastcall ReadData(System::Int8 &Buffer, NativeInt Count)/* overload */;
NativeInt __fastcall ReadData(System::Byte &Buffer)/* overload */;
NativeInt __fastcall ReadData(System::Byte &Buffer, NativeInt Count)/* overload */;
NativeInt __fastcall ReadData(short &Buffer)/* overload */;
NativeInt __fastcall ReadData(short &Buffer, NativeInt Count)/* overload */;
NativeInt __fastcall ReadData(System::Word &Buffer)/* overload */;
NativeInt __fastcall ReadData(System::Word &Buffer, NativeInt Count)/* overload */;
NativeInt __fastcall ReadData(int &Buffer)/* overload */;
NativeInt __fastcall ReadData(int &Buffer, NativeInt Count)/* overload */;
NativeInt __fastcall ReadData(unsigned &Buffer)/* overload */;
NativeInt __fastcall ReadData(unsigned &Buffer, NativeInt Count)/* overload */;
NativeInt __fastcall ReadData(__int64 &Buffer)/* overload */;
NativeInt __fastcall ReadData(__int64 &Buffer, NativeInt Count)/* overload */;
NativeInt __fastcall ReadData(unsigned __int64 &Buffer)/* overload */;
NativeInt __fastcall ReadData(unsigned __int64 &Buffer, NativeInt Count)/* overload */;
NativeInt __fastcall ReadData(float &Buffer)/* overload */;
NativeInt __fastcall ReadData(float &Buffer, NativeInt Count)/* overload */;
NativeInt __fastcall ReadData(double &Buffer)/* overload */;
NativeInt __fastcall ReadData(double &Buffer, NativeInt Count)/* overload */;
NativeInt __fastcall ReadData(System::Extended &Buffer)/* overload */;
NativeInt __fastcall ReadData(System::Extended &Buffer, NativeInt Count)/* overload */;
NativeInt __fastcall ReadData(System::TExtended80Rec &Buffer)/* overload */;
NativeInt __fastcall ReadData(System::TExtended80Rec &Buffer, NativeInt Count)/* overload */;
template<typename T> NativeInt __fastcall ReadData(T &Buffer)/* overload */;
template<typename T> NativeInt __fastcall ReadData(T &Buffer, NativeInt Count)/* overload */;
Propriétés
| Type | Visibilité | Source | Unité | Parent |
|---|---|---|---|---|
| function | public | System.Classes.pas System.Classes.hpp |
System.Classes | TStream |
Description
Méthodes responsables de lire jusqu'à Count, sans toutefois dépasser le nombre d'octets SizeOf(Buffer) du flux vers Buffer.
ReadData est utilisée quand le nombre d'octets à lire dans le flux n'est pas nécessairement fixé.
ReadData fonctionne en utilisant les algorithmes suivants :
- Si ReadData ne contient pas le paramètre
Count, ReadData essaie de lire le nombre d'octetsSizeOf(Buffer), puis avance la position en cours dans le flux du nombre d'octets transférés. ReadData renvoie le nombre d'octets lus. - Si ReadData contient le paramètre
Count:- Si
Count> SizeOf(Buffer), ReadData tente de lire le nombre d'octetsSizeOf(Buffer). ReadData avance la position en cours dans le flux du nombre d'octetsCount. ReadData renvoieCount. - Si
Count<= SizeOf(Buffer), ReadData tente de lire le nombre d'octetsCountdans le flux. ReadData avance la position en cours dans le flux du nombre d'octets transférés. ReadData renvoie le nombre d'octets lus.
- Si
La méthode ReadData appelle Read pour effectuer leur lecture réelle.