Fennel: ByteArrayOutputStream Class Reference (original) (raw)

ByteArrayOutputStream implements the ByteOutputStream interface by writing data to an existing fixed-size array of bytes. More...

#include <[ByteArrayOutputStream.h](ByteArrayOutputStream%5F8h-source.html)>

Inheritance diagram for ByteArrayOutputStream:

List of all members.

Public Member Functions
void clear ()
Clears any data written to the buffer, leaving it in the same state as after construction.
void writeBytes (void const *pData, uint cbRequested)
Writes bytes to the stream.
PBuffer getWritePointer (uint cbRequested, uint *pcbActual=NULL)
Copyless alternative for writing bytes to the stream.
void consumeWritePointer (uint cbUsed)
Advances stream position after a call to getWritePointer.
void hardPageBreak ()
Marks the current buffer as complete regardless of how much data it contains.
virtual void setWriteLatency (WriteLatency writeLatency)
Changes the write latency.
template
void writeValue (T const &value)
Writes a fixed-size type to the stream.
FileSize getOffset () const
**Returns:**current offset from beginning of stream
bool isClosed () const
**Returns:**whether the object has been closed
void close ()
Closes this object, releasing any unallocated resources.
Static Public Member Functions
static SharedByteArrayOutputStream newByteArrayOutputStream (PBuffer pBuffer, uint cbBuffer)
Creates a new ByteArrayOutputStream.
Protected Member Functions
void setBuffer (PBuffer pBuffer, uint cbBuffer)
Sets the current buffer to be written.
uint getBytesAvailable () const
**Returns:**number of bytes remaining to be written in current buffer
Protected Attributes
WriteLatency writeLatency
Current write latency mode.
FileSize cbOffset
Byte position in stream.
bool needsClose
Private Member Functions
virtual void flushBuffer (uint cbRequested)
Must be implemented by derived class to flush buffered data.
virtual void closeImpl ()
Must be implemented by derived class to release any resources.
ByteArrayOutputStream (PBuffer pBuffer, uint cbBuffer)
Private Attributes
PBuffer pBuffer
uint cbBuffer

Detailed Description

ByteArrayOutputStream implements the ByteOutputStream interface by writing data to an existing fixed-size array of bytes.

Definition at line 35 of file ByteArrayOutputStream.h.


Constructor & Destructor Documentation

ByteArrayOutputStream::ByteArrayOutputStream ( PBuffer pBuffer,
uint cbBuffer
) [explicit, private]

Member Function Documentation

void ByteArrayOutputStream::flushBuffer ( uint cbRequested ) [private, virtual]

Must be implemented by derived class to flush buffered data.

Parameters:

cbRequested if non-zero, the derived class should allocate a new buffer with at least the requested size and call setBuffer

Implements ByteOutputStream.

Definition at line 47 of file ByteArrayOutputStream.cpp.

00048 { 00049 permAssert(false); 00050 }

| void ByteArrayOutputStream::closeImpl | ( | | ) | [private, virtual] | | ------------------------------------- | - | | - | -------------------- |

| void ByteArrayOutputStream::clear | ( | | ) | | --------------------------------- | - | | - |

void ByteOutputStream::setBuffer ( PBuffer pBuffer,
uint cbBuffer
) [inline, protected, inherited]

| uint ByteOutputStream::getBytesAvailable | ( | | ) | const [inline, protected, inherited] | | ----------------------------------------------------------------------------------------------------- | - | | - | -------------------------------------- |

void ByteOutputStream::writeBytes ( void const * pData,
uint cbRequested
) [inherited]
PBuffer ByteOutputStream::getWritePointer ( uint cbRequested,
uint * pcbActual = NULL
) [inline, inherited]
void ByteOutputStream::consumeWritePointer ( uint cbUsed ) [inline, inherited]

| void ByteOutputStream::hardPageBreak | ( | | ) | [inherited] | | ------------------------------------ | - | | - | ------------- |

void ByteOutputStream::setWriteLatency ( WriteLatency writeLatency ) [virtual, inherited]

template

void ByteOutputStream::writeValue ( T const & value ) [inline, inherited]

| FileSize ByteStream::getOffset | ( | | ) | const [inline, inherited] | | ---------------------------------------------------------------------------------- | - | | - | --------------------------- |

| bool ClosableObject::isClosed | ( | | ) | const [inline, inherited] | | ----------------------------- | - | | - | --------------------------- |

Returns:

whether the object has been closed

Definition at line 58 of file ClosableObject.h.

| void ClosableObject::close | ( | | ) | [inherited] | | -------------------------- | - | | - | ------------- |

Closes this object, releasing any unallocated resources.

Reimplemented in CollectExecStream, CorrelationJoinExecStream, LcsClusterAppendExecStream, and LcsClusterReplaceExecStream.

Definition at line 39 of file ClosableObject.cpp.

References ClosableObject::closeImpl(), and ClosableObject::needsClose.

Referenced by CacheImpl< PageT, VictimPolicyT >::allocatePages(), LcsRowScanBaseExecStream::closeImpl(), ExecStreamGraphImpl::closeImpl(), FlatFileBuffer::open(), ClosableObjectDestructor::operator()(), and Segment::~Segment().


Member Data Documentation

Byte position in stream.

Definition at line 41 of file ByteStream.h.

Referenced by ByteStream::ByteStream(), ByteInputStream::consumeReadPointer(), ByteOutputStream::consumeWritePointer(), ByteStream::getOffset(), SegOutputStream::getSegPos(), SegInputStream::getSegPos(), ByteInputStream::readBytes(), ByteInputStream::reset(), ByteArrayInputStream::resetArray(), ByteInputStream::seekBackward(), SegInputStream::seekSegPos(), and ByteOutputStream::writeBytes().


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


Generated on Mon Jun 22 04:00:26 2009 for Fennel by doxygen 1.5.1