Qore Programming Language Reference Manual  0.8.12.3
Qore::BinaryOutputStream Class Reference

This class implements the OutputStream interface for writing bytes to a Binary buffer. More...

Inheritance diagram for Qore::BinaryOutputStream:

Public Member Functions

nothing close ()
 Closes the output stream and releases any resources. More...
 
 constructor ()
 Creates the BinaryOutputStream.
 
binary getData ()
 Returns the data written to the stream, clearing the internal buffer. More...
 
nothing write (binary data)
 Writes bytes to the output stream. More...
 
- Public Member Functions inherited from Qore::OutputStream
 constructor ()
 Constructor. More...
 

Detailed Description

This class implements the OutputStream interface for writing bytes to a Binary buffer.

Since
Qore 0.8.13
Example: BinaryOutputStream basic usage
1 BinaryOutputStream bos();
2 bos.write(<0405>);
3 bos.write(<06>);
4 bos.getData(); # returns <040506>

Member Function Documentation

nothing Qore::BinaryOutputStream::close ( )
virtual

Closes the output stream and releases any resources.

Any methods called on a closed output stream will throw an exception.

Implements Qore::OutputStream.

binary Qore::BinaryOutputStream::getData ( )

Returns the data written to the stream, clearing the internal buffer.

Returns
the data written to the BinaryOutputStream
Example:
1 BinaryOutputStream bos();
2 bos.write(<0405>);
3 bos.write(<06>);
4 bos.getData(); # returns <040506>
nothing Qore::BinaryOutputStream::write ( binary  data)
virtual

Writes bytes to the output stream.

Parameters
datathe data to write
Example:
1 BinaryOutputStream bos();
2 bos.write(<0405>);
3 bos.write(<06>);
4 bos.getData(); # returns <040506>

Implements Qore::OutputStream.