template class Poco::BasicMemoryBinaryReader

A convenient wrapper for using Buffer and MemoryStream with BinaryReader.

#include <BinaryReader.h>

template <typename T>
class BasicMemoryBinaryReader: public Poco::BinaryReader
{
public:
    // construction

    BasicMemoryBinaryReader(
        const Buffer<T>& data,
        StreamByteOrder byteOrder = NATIVE_BYTE_ORDER
        );

    BasicMemoryBinaryReader(
        const Buffer<T>& data,
        TextEncoding& encoding,
        StreamByteOrder byteOrder = NATIVE_BYTE_ORDER
        );

    // methods

    const Buffer<T>&
    data() const;

    const MemoryInputStream&
    stream() const;

    MemoryInputStream&
    stream();
};

Inherited Members

public:
    // enums

    enum StreamByteOrder;

    // methods

    BinaryReader&
    operator>>(bool& value);

    BinaryReader&
    operator>>(char& value);

    BinaryReader&
    operator>>(unsigned char& value);

    BinaryReader&
    operator>>(signed char& value);

    BinaryReader&
    operator>>(short& value);

    BinaryReader&
    operator>>(unsigned short& value);

    BinaryReader&
    operator>>(int& value);

    BinaryReader&
    operator>>(unsigned int& value);

    BinaryReader&
    operator>>(long& value);

    BinaryReader&
    operator>>(unsigned long& value);

    BinaryReader&
    operator>>(float& value);

    BinaryReader&
    operator>>(double& value);

    BinaryReader&
    operator>>(std::string& value);

    template <typename T>
    BinaryReader&
    operator>>(std::vector<T>& value);

    void
    read7BitEncoded(UInt32& value);

    void
    readRaw(
        std::streamsize length,
        std::string& value
        );

    void
    readRaw(
        char* buffer,
        std::streamsize length
        );

    void
    readBOM();

    bool
    good();

    bool
    fail();

    bool
    bad();

    bool
    eof();

    std::istream&
    stream() const;

    StreamByteOrder
    byteOrder() const;

    void
    setExceptions(std::ios_base::iostate st = (std::istream::failbit|std::istream::badbit));

    std::streamsize
    available() const;