System.Classes.TStream.WriteData

提供: RAD Studio API Documentation
移動先: 案内検索

Delphi

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

C++

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

プロパティ

種類 可視性 ソース ユニット
function public
System.Classes.pas
System.Classes.hpp
System.Classes TStream


説明

Buffer からストリームへ、最大 Count バイトを書き込むためのメソッド群です。

WriteData は、ストリームへ書き込むバイト数が固定であるとは限らない場合に使用します。

WriteData が動作するアルゴリズムは以下のとおりです。

  • WriteDataCount パラメータがない場合、WriteDataSizeOf(Buffer) バイトの書き込みを試みます。WriteData は、ストリーム内の現在位置を、転送したバイト数だけ先に進めます。WriteData は書き込んだバイト数を返します。
  • WriteDataCount パラメータがある場合、
    • Count > SizeOf(Buffer) であれば、WriteDataSizeOf(Buffer) バイトの書き込みを試みます。WriteData は、ストリーム内の現在位置を、Count バイトだけ先に進めます。
    • Count <= SizeOf(Buffer) であれば、WriteData は、ストリームへ最大 Count バイトを書き込もうと試み、ストリーム内の現在位置を転送したバイト数だけ先に進めます。WriteData は書き込んだバイト数を返しますが、これは Count より小さい可能性があります。

WriteData メソッドでは、Write を呼び出して実際の書き込みを行います。

関連項目