binostream
provides an output-only binary stream.
binio.h
binostream()
~binostream()
void writeInt(Int val, unsigned int size);
val
of size size
(in bytes) to
the stream.
void writeFloat(Float f, FType ft);
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.
unsigned long writeString(const char *str, unsigned long amount = 0);
unsigned long writeString(const std::string &str);
string
objects are
supported.
The standard C version takes a pointer str
to the
ASCIIZ string to write as first argument and an optional
second argument amount
, which specifies the number of
characters to write from that string. If it is omitted, the whole
string is written to the stream.
For the string
object version, the only argument is the
string
object, containing the string to write.
Both methods return the number of characters actually written to the stream (which should only differ from the value you wanted to write when an error occured).
virtual void putByte(Byte)