00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016 #ifndef COH_OCTET_ARRAY_READ_BUFFER_HPP
00017 #define COH_OCTET_ARRAY_READ_BUFFER_HPP
00018
00019 #include "coherence/lang.ns"
00020
00021 #include "coherence/io/AbstractReadBuffer.hpp"
00022
00023 COH_OPEN_NAMESPACE2(coherence,io)
00024
00025 class OctetArrayWriteBuffer;
00026
00027
00028
00029
00030
00031
00032
00033 class COH_EXPORT OctetArrayReadBuffer
00034 : public cloneable_spec<OctetArrayReadBuffer,
00035 extends<AbstractReadBuffer> >
00036 {
00037 friend class factory<OctetArrayReadBuffer>;
00038
00039
00040
00041 public:
00042 typedef this_spec::Handle Handle;
00043 typedef this_spec::View View;
00044 typedef this_spec::Holder Holder;
00045
00046
00047
00048
00049 protected:
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059 OctetArrayReadBuffer(Array<octet_t>::View vab, size32_t of,
00060 size32_t cb, bool fCopy = false);
00061
00062
00063
00064
00065 OctetArrayReadBuffer(const OctetArrayReadBuffer& that);
00066
00067
00068
00069
00070 public:
00071
00072
00073
00074 virtual size32_t length() const;
00075
00076
00077
00078
00079 virtual octet_t read(size32_t of) const;
00080
00081
00082
00083
00084 virtual void read(size32_t ofBegin, size32_t ofEnd,
00085 Array<octet_t>::Handle habDest, size32_t ofDest) const;
00086
00087
00088
00089
00090 virtual Array<octet_t>::View toOctetArray(size32_t of, size32_t cb) const;
00091
00092
00093
00094
00095 using AbstractReadBuffer::toOctetArray;
00096
00097
00098
00099
00100 public:
00101
00102
00103
00104 virtual void toStream(std::ostream& out) const;
00105
00106
00107
00108
00109 protected:
00110
00111
00112
00113
00114
00115
00116 virtual void updateLength(size32_t cb);
00117
00118
00119
00120
00121 virtual ReadBuffer::View instantiateReadBuffer(size32_t of,
00122 size32_t cb) const;
00123
00124
00125
00126
00127 virtual BufferInput::Handle instantiateBufferInput() const;
00128
00129
00130
00131
00132 public:
00133
00134
00135
00136
00137
00138
00139 class COH_EXPORT OctetArrayBufferInput
00140 : public class_spec<OctetArrayBufferInput,
00141 extends<AbstractBufferInput> >
00142 {
00143 friend class factory<OctetArrayBufferInput>;
00144
00145
00146
00147 protected:
00148
00149
00150
00151
00152
00153
00154 OctetArrayBufferInput(OctetArrayReadBuffer::View vBuf);
00155
00156
00157
00158 public:
00159
00160
00161
00162 using AbstractBufferInput::read;
00163
00164
00165
00166
00167 virtual octet_t read();
00168
00169
00170
00171
00172 virtual void read(Array<octet_t>::Handle hab, size32_t of,
00173 size32_t cb);
00174
00175
00176
00177
00178 virtual char16_t readChar16();
00179
00180
00181
00182
00183 virtual int16_t readInt16();
00184
00185
00186
00187
00188 virtual int32_t readInt32();
00189
00190
00191
00192
00193 virtual int64_t readInt64();
00194
00195
00196
00197
00198 virtual float32_t readFloat32();
00199
00200
00201
00202
00203 virtual float64_t readFloat64();
00204
00205
00206
00207 protected:
00208
00209
00210
00211 virtual String::View convertUTF(size32_t of, size32_t cb) const;
00212 };
00213
00214
00215
00216
00217 protected:
00218
00219
00220
00221 FinalView<Array<octet_t> > m_vab;
00222
00223
00224
00225
00226 size32_t m_of;
00227
00228
00229
00230
00231
00232 size32_t m_cb;
00233
00234
00235
00236
00237 friend class OctetArrayWriteBuffer;
00238 };
00239
00240 COH_CLOSE_NAMESPACE2
00241
00242 #endif // COH_OCTET_ARRAY_READ_BUFFER_HPP