BinaryWriter.Create

Syntax

Create(Stream: IIOStream);

Parameters

Stream. The stream, to which binary data is written.

Description

The Create designer creates an object that enables the user to write data in the binary format.

Comments

Specify the stream connected with the place, to which binary data is written, as a value of the Stream parameter. Initialize the object of one of the following classes and specify it as a value of the Stream parameter:

Example

Sub UserProc;
Var
    f: IFileStream;
    BinWriter: IBinaryWriter;
Begin
    f := New FileStream.Create("c:\BinFile.dat", FileOpenMode.Create, FileShare.Exclusive);
    BinWriter := New BinaryWriter.Create(f);
    BinWriter.WriteString("New Line");
    BinWriter.Flush;
    Dispose f;
End Sub UserProc;

On executing the example, the new file BinFile.dat is created. The specified character string is written into this file in a binary format.

See also:

BinaryWriter