|
OpenTop 1.3 | |||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | Cross-Platform C++ | ||||
SUMMARY: CONSTRUCTOR | METHOD | DETAIL: CONSTRUCTOR | METHOD |
#include "ot/io/ByteArrayOutputStream.h"
When bytes are written to this output stream, they are copied into the internal buffer. The buffer is automatically expanded as additional bytes are written to it.
The buffered data may be retrieved at any time using the data() and size() methods.
Constructor/Destructor Summary | |
ByteArrayOutputStream() Creates a ByteArrayOutputStream with a default initial buffer size. | |
ByteArrayOutputStream(size_t size) Creates a ByteArrayOutputStream with a specified initial buffer size. |
Method Summary | |
virtual void |
close() Closes the ByteArrayOutputStream. |
const Byte* |
data() const Returns a constant pointer to the start of the internal byte buffer. |
void |
reset() Resets the internal buffer to zero size. |
size_t |
size() const Returns the number of bytes written to the internal byte buffer. |
String |
toString() const Converts the bytes in the internal buffer into a Unicode character string using the default encoding. |
String |
toString(const String& encoding) const Converts the bytes in the internal buffer into a Unicode character string using the supplied encoding name. |
String |
toString(CodeConverter* pDecoder) const Converts the bytes in the internal buffer into a Unicode character string using the supplied CodeConverter. |
virtual void |
write(const Byte* pBuffer, size_t bufLen) Writes an array of bytes to this output stream. |
void |
writeTo(OutputStream* pOut) const Writes the contents of the internal buffer to the specified OutputStream. |
Methods inherited from class ot::ManagedObject |
addRef, getRefCount, onFinalRelease, operator=, release |
Methods inherited from class ot::io::OutputStream |
flush, flushBuffers, write |
Constructor/Destructor Detail |
ByteArrayOutputStream()
ByteArrayOutputStream(size_t size)
size
- Method Detail |
virtual void close()
const Byte* data() const
void reset()
size_t size() const
String toString() const
UnsupportedEncodingException
- String toString(const String& encoding) const
enc
- UnsupportedEncodingException
- String toString(CodeConverter* pDecoder) const
pDecoder
- virtual void write(const Byte* pBuffer, size_t bufLen)
pBuffer
- bufLen
- NullPointerException
- IOException
- void writeTo(OutputStream* pOut) const
pOut
- IOException
- NullPointerException
-
|
OpenTop 1.3 | |||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | Cross-Platform C++ | ||||
SUMMARY: CONSTRUCTOR | METHOD | DETAIL: CONSTRUCTOR | METHOD |