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 */;
Properties
| Type | Visibility | Source | Unit | Parent |
|---|---|---|---|---|
| function | public | System.Classes.pas System.Classes.hpp |
System.Classes | TStream |
Description
Methods responsible for reading up to Count but not more than SizeOf(Buffer) bytes from the stream into Buffer.
ReadData is used in cases, where the number of bytes to read from the stream is not necessarily fixed.
ReadData works using the following algorithms:
- When ReadData does not have the
Countparameter, then ReadData tries to read theSizeOf(Buffer)number of bytes, then advances the current position in the stream by the number of bytes transferred. ReadData returns the number of bytes read. - When ReadData has the
Countparameter, then:- If
Count> SizeOf(Buffer), then ReadData tries to read theSizeOf(Buffer)number of bytes. ReadData advances the current position in the stream byCountnumber of bytes. ReadData returnsCount. - If
Count<= SizeOf(Buffer), then ReadData tries to read up to theCountnumber of bytes from the stream. ReadData advances the current position in the stream by the number of bytes transferred. ReadData returns the number of bytes read.
- If
ReadData methods call Read to do their actual reading.