A convinience class to write data into an OutputStream. More...
#include <Stream.hh>
Public Member Functions | |
StreamWriter () | |
Constructs a writer with no underlying stream. | |
StreamWriter (OutputStream &out) | |
Constructs a new writer with the given underlying stream. | |
void | reset (OutputStream &os) |
Replaces the current underlying stream with a new one. More... | |
void | write (uint8_t c) |
Writes a single byte. | |
void | writeBytes (const uint8_t *b, size_t n) |
Writes the specified number of bytes starting at b . | |
void | flush () |
backs up upto the currently written data and flushes the underlying stream. | |
void | more () |
Gets more space to write to. More... | |
Public Attributes | |
OutputStream * | out_ |
The underlying output stream for this writer. | |
uint8_t * | next_ |
The next location to write to. | |
uint8_t * | end_ |
One past the last location one can write to. | |
A convinience class to write data into an OutputStream.
|
inline |
Gets more space to write to.
Throws an exception it cannot.
References avro::OutputStream::next().
Referenced by write(), and writeBytes().
|
inline |
Replaces the current underlying stream with a new one.
If required, it backs up unused bytes in the previous stream.
References avro::OutputStream::backup(), and end_.
Referenced by StreamWriter().