31 #include "BlockingStream.h"
33 #include "ReadingBuffer.h"
34 #include "WritingBuffer.h"
48 inline bool BlockingStream::checkInterrupted()
64 unsigned char* d =
reinterpret_cast<unsigned char*
>(dest);
74 if (!
fill())
return false;
92 if (!
fill())
return false;
103 const unsigned char* s =
reinterpret_cast<const unsigned char*
>(src);
107 size_t copied = writingBuffer.
append(s, length);
111 if (length==0)
break;
112 if (!
flush())
return false;
126 if (writingBuffer.
write()) {
128 }
else if (writingBuffer.
failed()) {
147 readingBuffer.
reset();
152 if (readingBuffer.
read()) {
155 }
else if (readingBuffer.
failed()) {
bool write(const void *src, size_t length)
bool read(void *dest, size_t length)
size_t extract(void *dest, size_t size, size_t offset=0) const
size_t append(const void *src, size_t size)
WritingBuffer & getWritingBuffer()
ReadingBuffer & getReadingBuffer()
errorCode_t getErrorCode() const
errorCode_t getErrorCode() const
void setErrorCode(errorCode_t ec)
bool wait(int timeout=-1)