63 for (ii = 0; ii < nmemb; ++ii)
80 for (ii = 0; ii < nmemb; ++ii)
117 return _stream->available() != 0;
139 return nullptr !=
_gzfp;
153#define GZREAD(ptr,len) (_gzfp?gz_read(_gzfp,ptr,len):0)
162 out =
static_cast<unsigned char>(
rBuf[0]);
182 out = (
static_cast<unsigned char>(
rBuf[1]) << 8 |
static_cast<unsigned char>(
rBuf[0]));
193 out = (
static_cast<unsigned char>(
rBuf[3]) << 24 |
static_cast<unsigned char>(
rBuf[2]) << 16 |
194 static_cast<unsigned char>(
rBuf[1]) << 8 |
static_cast<unsigned char>(
rBuf[0]));
212 :
_stream->readBytes(
static_cast<byte *
>(ptr),
size);
223 size_t remain =
size;
236 return size - remain;
320 out =
static_cast<unsigned int>(
ptr[
pos - 1] << 24 |
ptr[
pos - 2] << 16 |
virtual bool read2b(unsigned short &out)=0
virtual bool state() const =0
virtual bool read4b(unsigned int &out)=0
virtual size_t skipBlock(size_t size) override
virtual size_t readBlock(void *ptr, size_t size) override
virtual bool read1b(unsigned char &out) override
virtual ~HMemIODev() override
virtual void init() override
virtual bool read4b(unsigned int &out) override
virtual bool state() const override
HMemIODev(char *s, size_t len)
virtual bool read2b(unsigned short &out) override
virtual void flush() override
virtual bool setCompressed(bool) override
virtual bool open() override
virtual size_t readBlock(void *ptr, size_t size) override
Read some bytes from stream to given pointer as amount of size.
virtual void flush() override
If the stream is gzipped, flush the stream.
virtual bool read1b(unsigned char &out) override
Read one byte from stream.
virtual ~HStreamIODev() override
virtual size_t skipBlock(size_t size) override
Move current pointer of stream as amount of size.
virtual bool read2b(unsigned short &out) override
std::unique_ptr< HStream > _stream
HStreamIODev(std::unique_ptr< HStream > stream)
virtual bool setCompressed(bool) override
Set whether the stream is compressed or not.
virtual bool read4b(unsigned int &out) override
virtual bool open() override
Check whether the stream is available.
virtual void init() override
Initialize this object.
virtual bool state() const override
Not implemented.
Reference< XOutputStream > stream
gz_stream * gz_open(HStream &_stream)
Opens a gzipped stream for reading.
int gz_close(gz_stream *file)
Flushes all pending output if necessary, closes the compressed stream and deallocates all the (de)com...
int gz_flush(gz_stream *file, int flush)
Flushes all pending output into the compressed file gz_flush should be called only when strictly nece...
static uchar rBuf[BUFSIZE]