Avro C++
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator
Public Member Functions | Public Attributes | List of all members
avro::StreamWriter Struct Reference

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

OutputStreamout_
 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.
 

Detailed Description

A convinience class to write data into an OutputStream.

Member Function Documentation

void avro::StreamWriter::more ( )
inline

Gets more space to write to.

Throws an exception it cannot.

References avro::OutputStream::next().

Referenced by write(), and writeBytes().

void avro::StreamWriter::reset ( OutputStream os)
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().


The documentation for this struct was generated from the following file: