19 setBuf(buf, bufSize, shared);
61 char_type* tempBuf = buf;
62 if(!shared&&bufSize&&buf)
64 tempBuf =
new char_type[bufSize];
65 memcpy(tempBuf, buf, bufSize);
118 int_type result = __c;
123 if(__c != traits_type::eof())
125 *gptr() =
static_cast<char_type
>(__c);
130 result = traits_type::eof();
135 std::ios_base::openmode __mode)
137 pos_type result = pos_type(off_type(-1));
138 if((__mode & std::ios_base::in)&&
139 (__mode & std::ios_base::out))
147 case std::ios_base::beg:
155 result = pos_type(offset);
157 if(__mode & std::ios_base::in)
159 gbump(offset - (gptr() - eback()));
161 else if(__mode & std::ios_base::out)
163 pbump(offset - (pptr() - pbase()));
167 case std::ios_base::cur:
172 pos_type newPosition = result;
174 if(__mode & std::ios_base::in)
176 delta = gptr()-eback();
178 else if(__mode & std::ios_base::out)
180 delta = pptr()-pbase();
182 newPosition = pos_type(delta + offset);
185 result = newPosition;
186 if(__mode & std::ios_base::in)
190 else if(__mode & std::ios_base::out)
197 case std::ios_base::end:
199 pos_type newPosition = result;
201 if(__mode & std::ios_base::in)
203 delta = egptr()-eback();
205 else if(__mode & std::ios_base::out)
207 delta = epptr()-pbase();
209 newPosition = pos_type(delta + offset);
212 result = newPosition;
213 if(__mode & std::ios_base::in)
215 gbump(offset - (gptr() - eback()));
217 else if(__mode & std::ios_base::out)
219 pbump(offset - (epptr() - pptr()));
234 pos_type result = pos_type(off_type(-1));
236 if(__mode & std::ios_base::in)
247 else if(__mode & std::ios_base::out)
278 if(bytesToRead > bytesLeftToRead)
280 bytesToRead = bytesLeftToRead;
284 std::memcpy(__s, gptr(), bytesToRead);
287 return std::streamsize(bytesToRead);
294 if(__n > bytesLeftToWrite)
302 bytesToWrite = bytesLeftToWrite;
307 std::memcpy(pptr(), __s, bytesToWrite);
326 char* inBegin = eback();
327 char* inCur = gptr();
virtual std::streambuf * setbuf(char_type *s, std::streamsize n)
virtual std::streamsize xsputn(const char_type *__s, std::streamsize __n)
virtual std::streamsize xsgetn(char_type *__s, std::streamsize __n)
ossim_uint64 bufferSize() const
char_type * takeBuffer()
The buffer is no longer managed by this stream buffer and is removed.
virtual int overflow(int c=EOF)
char_type * buffer()
Returns a pointer to the buffer.
virtual pos_type seekoff(off_type offset, std::ios_base::seekdir dir, std::ios_base::openmode __mode=std::ios_base::in|std::ios_base::out)
os2<< "> n<< " > nendobj n
unsigned long long ossim_uint64
unsigned int ossim_uint32
virtual pos_type seekpos(pos_type pos, std::ios_base::openmode __mode=std::ios_base::in|std::ios_base::out)
std::streambuf * setBuf(char *buf, std::streamsize bufSize, bool shared)
void extendBuffer(ossim_uint64 bytes)
virtual ~ossimByteStreamBuffer()
virtual int_type pbackfail(int_type __c=traits_type::eof())