System.Classes.TStream.WriteData

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

function WriteData(const Buffer: TBytes; Count: Longint): Longint; overload;
function WriteData(const Buffer: Pointer; Count: Longint): Longint; overload;
function WriteData(const Buffer: Boolean): Longint; overload;
function WriteData(const Buffer: Boolean; Count: Longint): Longint; overload;
function WriteData(const Buffer: AnsiChar): Longint; overload;
function WriteData(const Buffer: AnsiChar; Count: Longint): Longint; overload;
function WriteData(const Buffer: Char): Longint; overload;
function WriteData(const Buffer: Char; Count: Longint): Longint; overload;
function WriteData(const Buffer: Int8): Longint; overload;
function WriteData(const Buffer: Int8; Count: Longint): Longint; overload;
function WriteData(const Buffer: UInt8): Longint; overload;
function WriteData(const Buffer: UInt8; Count: Longint): Longint; overload;
function WriteData(const Buffer: Int16): Longint; overload;
function WriteData(const Buffer: Int16; Count: Longint): Longint; overload;
function WriteData(const Buffer: UInt16): Longint; overload;
function WriteData(const Buffer: UInt16; Count: Longint): Longint; overload;
function WriteData(const Buffer: Int32): Longint; overload;
function WriteData(const Buffer: Int32; Count: Longint): Longint; overload;
function WriteData(const Buffer: UInt32): Longint; overload;
function WriteData(const Buffer: UInt32; Count: Longint): Longint; overload;
function WriteData(const Buffer: Int64): Longint; overload;
function WriteData(const Buffer: Int64; Count: Longint): Longint; overload;
function WriteData(const Buffer: UInt64): Longint; overload;
function WriteData(const Buffer: UInt64; Count: Longint): Longint; overload;
function WriteData(const Buffer: Single): Longint; overload;
function WriteData(const Buffer: Single; Count: Longint): Longint; overload;
function WriteData(const Buffer: Double): Longint; overload;
function WriteData(const Buffer: Double; Count: Longint): Longint; overload;
function WriteData(const Buffer: Extended): Longint; overload;
function WriteData(const Buffer: Extended; Count: Longint): Longint; overload;
function WriteData(const Buffer: TExtended80Rec): Longint; overload;
function WriteData(const Buffer: TExtended80Rec; Count: Longint): Longint; overload;

C++

int __fastcall WriteData(const System::DynamicArray<System::Byte> Buffer, int Count)/* overload */;
int __fastcall WriteData(const void * Buffer, int Count)/* overload */;
int __fastcall WriteData(const bool Buffer)/* overload */;
int __fastcall WriteData(const bool Buffer, int Count)/* overload */;
int __fastcall WriteData(const char Buffer)/* overload */;
int __fastcall WriteData(const char Buffer, int Count)/* overload */;
int __fastcall WriteData(const System::WideChar Buffer)/* overload */;
int __fastcall WriteData(const System::WideChar Buffer, int Count)/* overload */;
int __fastcall WriteData(const System::Int8 Buffer)/* overload */;
int __fastcall WriteData(const System::Int8 Buffer, int Count)/* overload */;
int __fastcall WriteData(const System::Byte Buffer)/* overload */;
int __fastcall WriteData(const System::Byte Buffer, int Count)/* overload */;
int __fastcall WriteData(const short Buffer)/* overload */;
int __fastcall WriteData(const short Buffer, int Count)/* overload */;
int __fastcall WriteData(const System::Word Buffer)/* overload */;
int __fastcall WriteData(const System::Word Buffer, int Count)/* overload */;
int __fastcall WriteData(const int Buffer)/* overload */;
int __fastcall WriteData(const int Buffer, int Count)/* overload */;
int __fastcall WriteData(const unsigned Buffer)/* overload */;
int __fastcall WriteData(const unsigned Buffer, int Count)/* overload */;
int __fastcall WriteData(const __int64 Buffer)/* overload */;
int __fastcall WriteData(const __int64 Buffer, int Count)/* overload */;
int __fastcall WriteData(const unsigned __int64 Buffer)/* overload */;
int __fastcall WriteData(const unsigned __int64 Buffer, int Count)/* overload */;
int __fastcall WriteData(const float Buffer)/* overload */;
int __fastcall WriteData(const float Buffer, int Count)/* overload */;
int __fastcall WriteData(const double Buffer)/* overload */;
int __fastcall WriteData(const double Buffer, int Count)/* overload */;
int __fastcall WriteData(const System::Extended Buffer)/* overload */;
int __fastcall WriteData(const System::Extended Buffer, int Count)/* overload */;
int __fastcall WriteData(const System::TExtended80Rec &Buffer)/* overload */;
int __fastcall WriteData(const System::TExtended80Rec &Buffer, int Count)/* overload */;

Properties

Type Visibility Source Unit Parent
function public
System.Classes.pas
System.Classes.hpp
System.Classes TStream

Description

Methods responsible for writing up to Count bytes from Buffer to the stream.

WriteData is used in cases, where the number of bytes to write to the stream is not necessarily fixed.

WriteData works using the following algorithms:

  • When WriteData does not have the Count parameter, then WriteData tries to write the SizeOf(Buffer) number of bytes. WriteData advances the current position in the stream by the number of bytes transferred. WriteData returns the number of bytes written.
  • When WriteData has the Count parameter, then:
    • If Count > SizeOf(Buffer), then WriteData tries to write the SizeOf(Buffer) number of bytes. WriteData advances the current position in the stream by the Count number of bytes.
    • If Count <= SizeOf(Buffer), then WriteData tries to write up to the Count number of bytes to the stream and then advances the current position in the stream by the number of bytes transferred. WriteData returns the number of bytes written, which may be less than Count.

WriteData methods call Write to do their actual writing.

See Also