Node:binostream, Next:, Previous:binistream, Up:Base classes



binostream

binostream provides an output-only binary stream.

Header file: binio.h

Public methods:

binostream()
The constructor.
~binostream()
The destructor.
void writeInt(Int val, unsigned int size);
Writes the integer value val of size size (in bytes) to the stream.
void writeFloat(Float f, FType ft);
Writes the floating-point value f of type ft to the stream. Refer to the list of public types of the binio class for information about what floating-point formats are supported.

If the requested floating-point type is not supported by your architecture, writeFloat() tries to convert it. This is not always possible and an Unsupported error is issued if the conversion fails and nothing is written to the stream in this case.

void writeString(const char *str);
void writeString(const std::string &str);
Writes a character string to the stream. Both standard C ASCIIZ strings and STL string objects are supported. The only argument is either a pointer to the ASCIIZ string buffer, or the string object, containing the string to write.

Protected methods:

virtual void putByte(Byte)
Abstract virtual method to insert exactly one byte (8 bits) into the stream and advance the stream pointer accordingly. The byte to be written is passed as the only argument. Implemented by the stream layer.