14ByteString BytesOutputStream::toByteString()
const
24BytesOutputStream::BytesOutputStream(
size_t _capacity)
32BytesOutputStream::~BytesOutputStream()
38 catch (Exception* cause) {
45void BytesOutputStream::close()
54OutputStream& BytesOutputStream::write(
const void* _buf,
size_t _n)
61 __buf = ByteBuffer::create_e(
__MAX(_n, __capacity));
62 else if (__buf->__refCount > 1) {
63 ByteBuffer*
buf = ByteBuffer::create_e(
__MAX(_n, __capacity));
64 memcpy(
buf->data(), __buf->data(), (__buf->__dataLength + 1) *
sizeof(
char));
66 buf->__dataLength = __buf->__dataLength;
74 ByteBuffer::write(__buf, (
const char*)_buf, _n);
79int BytesOutputStream::vprintf(
const char* _format, va_list _arglist)
85 __buf = ByteBuffer::create_e(__capacity);
86 else if (__buf->__refCount > 1) {
87 ByteBuffer*
buf = ByteBuffer::create_e(__capacity);
88 memcpy(
buf->data(), __buf->data(), (__buf->__dataLength + 1) *
sizeof(
wchar_t));
89 buf->__dataLength = __buf->__dataLength;
98 return ByteBuffer::vformat(__buf, _format, _arglist);
101size_t BytesOutputStream::writeTo(
OutputStream& _output)
const
104 if (__buf !=
NULL && __buf->__dataLength) {
105 _output.write(__buf->data(), __buf->__dataLength);
106 return __buf->__dataLength;
114 size_t n = writeTo(_output);
121void BytesOutputStream::reset()
124 if (
__buf->__refCount == 1) {
125 __buf->__dataLength = 0;
#define __DCL_TRACE1(fmt, arg1)
#define __DCL_ASSERT_PARAM(expr)
#define __DCL_ASSERT(expr)
#define IMPLEMENT_CLASSINFO(class_name, base_class_name)
void CharsetConvertException *size_t n
virtual String toString() const
size_t __MAX(size_t x, size_t y)