SourcePro® API Reference Guide

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

Additional Inherited Members

- Protected Member Functions inherited from RWHandleBase
 RWHandleBase (const RWHandleBase &second)
 
 RWHandleBase (RWBodyBase *body)
 
 RWHandleBase (RWStaticCtor)
 
 RWHandleBase (void)
 
 ~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() [1/2]

RWByteArrayOutputStream::RWByteArrayOutputStream ( RWByteArrayOutputStreamImp * body)
inlineexplicit

Constructor.

Parameters
bodyA pointer to an implementation class supporting the abstract interface RWByteArrayOutputStreamImp.

◆ RWByteArrayOutputStream() [2/2]

RWByteArrayOutputStream::RWByteArrayOutputStream ( const RWByteArrayOutputStream & handle)
inline

Copy constructor.

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

Member Function Documentation

◆ clear()

void RWByteArrayOutputStream::clear ( )
inline

Resets the underlying buffer.

◆ getByteArray()

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[].

◆ getByteArraySize()

RWSize RWByteArrayOutputStream::getByteArraySize ( ) const
inline

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

◆ operator=()

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

Assignment operator.

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

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