next up previous contents index
Next: Encoding File Stream ( Up: Lossless Compression Previous: Encoding Output Stream (   Contents   Index


Decoding Input Stream ( decoding_istream )

Definition

The type decoding_istream<Coder> is the decoding counterpart of the type istream from the C++ iostream library. Each instance is of type decoding_istream<Coder> is attached to a streambuf sb. Whenever data is requested from is, it reads some data from sb and then decodes it on-the-fly with an intance of type Coder. All operations and all operators (») defined for C++ istreams can be applied to decoding_istream as well.

#include < LEDA/coding/coder_util.h >

Creation

decoding_istream< Coder> is(streambuf* encoded_stream, bool own_stream = false)
    creates an instance is and attaches it to the given streambuf object.

Operations

Coder* is.get_coder() returns the instance of Coder which is used for encoding.

void is.close() detaches is from its streambuf object.

void is.finish() reads till the end of the stream and then closes is. (This is useful if Coder is a checksummer; the checksum is only verified after EOF has been read.)


next up previous contents index
Next: Encoding File Stream ( Up: Lossless Compression Previous: Encoding Output Stream (   Contents   Index
Christian Uhrig 2017-04-07