SourcePro® API Reference Guide

 
List of all members | Public Member Functions
RWByteArrayOutputStream Class Reference

Handle class for binary output streams, allowing retrieval of inserted data as a byte array. More...

#include <rw/stream/RWByteArrayOutputStream.h>

Inheritance diagram for RWByteArrayOutputStream:
RWByteOutputStream RWHandleBase

Public Member Functions

 RWByteArrayOutputStream (RWByteArrayOutputStreamImp *body)
 
 RWByteArrayOutputStream (const RWByteArrayOutputStream &handle)
 
void clear ()
 
RWBytegetByteArray ()
 
RWSize getByteArraySize () const
 
RWByteArrayOutputStreamoperator= (const RWByteArrayOutputStream &handle)
 
- Public Member Functions inherited from RWByteOutputStream
 RWByteOutputStream (RWByteOutputStreamImp *ptr)
 
 RWByteOutputStream (const RWByteOutputStream &handle)
 
void close ()
 
void flush ()
 
bool isBad () const
 
bool isFail () const
 
bool isGood () const
 
RWByteOutputStreamoperator<< (RWByteOutputStream &(*pf)(RWByteOutputStream &))
 
RWByteOutputStream operator<< (RWByteOutputStream(*pf)(RWByteOutputStream &))
 
RWByteOutputStreamoperator<< (RWByte byteValue)
 
RWByteOutputStreamoperator= (const RWByteOutputStream &handle)
 
void write (RWByte byteValue)
 
void write (const RWByte *byteArray, RWSize numBytes)
 
- Public Member Functions inherited from RWHandleBase
bool isValid (void) const
 
bool operator!= (const RWHandleBase &second) const
 
bool operator< (const RWHandleBase &second) const
 
bool operator== (const RWHandleBase &second) const
 

Additional Inherited Members

- Protected Member Functions inherited from RWHandleBase
 RWHandleBase (void)
 
 RWHandleBase (RWStaticCtor)
 
 RWHandleBase (RWBodyBase *body)
 
 RWHandleBase (const RWHandleBase &second)
 
 ~RWHandleBase (void)
 
RWBodyBasebody (void) const
 
RWHandleBaseoperator= (const RWHandleBase &second)
 

Detailed Description

The handle class for binary output streams supporting an extended interface that allows retrieval of their inserted data as a byte array. Implements the handle idiom from the handle-body pattern.

Constructor & Destructor Documentation

RWByteArrayOutputStream::RWByteArrayOutputStream ( RWByteArrayOutputStreamImp body)
inlineexplicit

Constructor.

Parameters
bodyA pointer to an implementation class supporting the abstract interface RWByteArrayOutputStreamImp.
RWByteArrayOutputStream::RWByteArrayOutputStream ( const RWByteArrayOutputStream handle)
inline

Copy constructor.

Parameters
handleA binary array stream handle used to initialize the newly created handle.

Member Function Documentation

void RWByteArrayOutputStream::clear ( void  )
inline

Resets the underlying buffer.

RWByte* RWByteArrayOutputStream::getByteArray ( )
inline

Returns a pointer to an array of bytes containing the bytes inserted into the stream since its creation. Users are responsible for freeing the memory associated with the array returned by this function, by using operator delete[].

RWSize RWByteArrayOutputStream::getByteArraySize ( ) const
inline

Returns the size of the byte array that would be returned by a call to function getByteArray().

RWByteArrayOutputStream& RWByteArrayOutputStream::operator= ( const RWByteArrayOutputStream handle)
inline

Assignment operator.

Parameters
handleA binary array stream handle used to initialize this handle.

Copyright © 2023 Rogue Wave Software, Inc., a Perforce company. All Rights Reserved.