decaf::io::ByteArrayOutputStream Class Reference

#include <src/main/decaf/io/ByteArrayOutputStream.h>

Inheritance diagram for decaf::io::ByteArrayOutputStream:
Inheritance graph
[legend]

Public Member Functions

 ByteArrayOutputStream ()
 Default Constructor - uses a default internal buffer of 32 bytes, the size increases as the need for more room arises.
 ByteArrayOutputStream (int bufferSize)
 Creates a ByteArrayOutputStream with an internal buffer allocated with the given size.
virtual ~ByteArrayOutputStream ()
std::pair< unsigned char *, int > toByteArray () const
 Creates a newly allocated byte array.
long long size () const
 Gets the current count of bytes written into this ByteArrayOutputStream.
virtual void reset ()
 Clear current Stream contents.
virtual std::string toString () const
 Converts the bytes in the buffer into a standard C++ string.
void writeTo (OutputStream *out) const
 Writes the complete contents of this byte array output stream to the specified output stream argument, as if by calling the output stream's write method using out.write( buf, 0, count ).

Protected Member Functions

virtual void doWriteByte (unsigned char value)
virtual void doWriteArrayBounded (const unsigned char *buffer, int size, int offset, int length)

Constructor & Destructor Documentation

decaf::io::ByteArrayOutputStream::ByteArrayOutputStream (  ) 

Default Constructor - uses a default internal buffer of 32 bytes, the size increases as the need for more room arises.

decaf::io::ByteArrayOutputStream::ByteArrayOutputStream ( int  bufferSize  ) 

Creates a ByteArrayOutputStream with an internal buffer allocated with the given size.

Parameters:
bufferSize The size to use for the internal buffer.
Exceptions:
IllegalArgumentException if the size is less than or equal to zero.
virtual decaf::io::ByteArrayOutputStream::~ByteArrayOutputStream (  )  [virtual]

Member Function Documentation

virtual void decaf::io::ByteArrayOutputStream::doWriteArrayBounded ( const unsigned char *  buffer,
int  size,
int  offset,
int  length 
) [protected, virtual]

Reimplemented from decaf::io::OutputStream.

virtual void decaf::io::ByteArrayOutputStream::doWriteByte ( unsigned char  value  )  [protected, virtual]
virtual void decaf::io::ByteArrayOutputStream::reset (  )  [virtual]

Clear current Stream contents.

Exceptions:
IOException 
long long decaf::io::ByteArrayOutputStream::size (  )  const

Gets the current count of bytes written into this ByteArrayOutputStream.

Returns:
the number of valid bytes contained in the ByteArrayOutputStream.
std::pair<unsigned char*, int> decaf::io::ByteArrayOutputStream::toByteArray (  )  const

Creates a newly allocated byte array.

Its size is the current size of this output stream and the valid contents of the buffer have been copied into it. The newly allocated array and its size are returned inside an STL pair structure, the caller is responsible for freeing the returned array.

Returns:
an STL pair containing the copied array and its size.
virtual std::string decaf::io::ByteArrayOutputStream::toString (  )  const [virtual]

Converts the bytes in the buffer into a standard C++ string.

Returns:
a string containing the bytes in the buffer

Reimplemented from decaf::io::OutputStream.

void decaf::io::ByteArrayOutputStream::writeTo ( OutputStream out  )  const

Writes the complete contents of this byte array output stream to the specified output stream argument, as if by calling the output stream's write method using out.write( buf, 0, count ).


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

Generated on 1 Dec 2014 for activemq-cpp-3.8.2 by  doxygen 1.6.1