Create(Stream: IIOStream);
Stream. The stream, to which binary data is written.
The Create designer creates an object that enables the user to write data in the binary format.
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:
FileStream. The stream connected with the file on the hard drive.
MemoryStream. The stream in the computer memory.
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: