DCL
4.0
Loading...
Searching...
No Matches
BytesOutputStream.h
Go to the documentation of this file.
1
#ifndef __DCL_BYTES_OUTPUT_STREAM_H__
2
#define __DCL_BYTES_OUTPUT_STREAM_H__ 20110221
3
4
#ifndef __DCL_OUTPUT_STRAEM_H__
5
#include <
dcl/OutputStream.h
>
6
#endif
7
#ifndef __DCL_STRING_H__
8
#include <
dcl/String.h
>
9
#endif
10
11
__DCL_BEGIN_NAMESPACE
12
23
class
DCLCAPI
BytesOutputStream :
public
OutputStream
24
{
25
DECLARE_CLASSINFO
(BytesOutputStream)
26
public
:
30
ByteString toByteString()
const
;
31
43
BytesOutputStream(
size_t
_initial = 4096);
44
49
virtual
~BytesOutputStream();
50
54
virtual
void
close()
55
__DCL_THROWS1
(
IOException
*);
56
66
virtual
OutputStream
& write(
const
void
* _buf,
size_t
_n)
67
__DCL_THROWS1
(
IOException
*);
68
77
virtual
size_t
writeTo(
OutputStream
& _output)
const
78
__DCL_THROWS1
(
IOException
*);
79
89
virtual
int
vprintf(
const
char
* _format, va_list _arglist)
90
__DCL_THROWS1
(
IOException
*);
91
100
virtual
size_t
flushTo(
OutputStream
& _output)
101
__DCL_THROWS1
(
IOException
*);
102
106
virtual
void
reset();
107
113
const
void
* data()
const
;
114
118
size_t
size()
const
;
119
120
protected
:
121
ByteBuffer*
__buf
;
122
size_t
__capacity
;
123
};
124
125
inline
const
void
* BytesOutputStream::data()
const
126
{
127
return
__buf
!=
NULL
?
__buf
->data() :
NULL
;
128
}
129
130
inline
size_t
BytesOutputStream::size()
const
131
{
132
return
__buf
!=
NULL
?
__buf
->__dataLength : 0;
133
}
134
135
__DCL_END_NAMESPACE
136
137
#endif
// __DCL_BYTES_OUTPUT_STREAM_H__
NULL
#define NULL
Definition
Config.h:340
DCLCAPI
#define DCLCAPI
Definition
Config.h:100
__DCL_THROWS1
#define __DCL_THROWS1(e)
Definition
Config.h:167
DECLARE_CLASSINFO
#define DECLARE_CLASSINFO(class_name)
Definition
Object.h:210
OutputStream.h
String.h
BytesOutputStream::__buf
ByteBuffer * __buf
Definition
BytesOutputStream.h:121
BytesOutputStream::__capacity
size_t __capacity
Definition
BytesOutputStream.h:122
IOException
Definition
Exception.h:93
OutputStream
Definition
OutputStream.h:31
include
dcl
BytesOutputStream.h
Generated by
1.14.0