class StaticByteStream: public ByteStream

Read-only ByteStream interface to a memory area.

Inheritance:


Public Methods

[more] StaticByteStream(const char *buffer, size_t sz)
Creates a StaticByteStream object for allocating the memory area of length sz starting at address buffer.
[more] StaticByteStream(const char *buffer)
Creates a StaticByteStream object for allocating the null terminated memory area starting at address buffer.
[more]virtual int size(void) const
Returns the total number of bytes contained in the buffer, file, etc.


Inherited from ByteStream:

Public

Virtual Functions.

[more]virtual ~ByteStream()
Virtual destructor.
[more]virtual size_t read(void *buffer, size_t size)
Reads data from a ByteStream.
[more]virtual size_t write(const void *buffer, size_t size)
Writes data to a ByteStream.
[more]virtual long tell(void) const
Returns the offset of the current position in the ByteStream.
[more]virtual int seek(long offset, int whence = SEEK_SET, bool nothrow=false)
Sets the current position for reading or writing the ByteStream.
[more]virtual void flush(void)
Flushes all buffers in the ByteStream.

Utility Functions.

[more]size_t readall(void *buffer, size_t size)
Reads data and blocks until everything has been read.
[more]size_t writall(const void *buffer, size_t size)
Writes data and blocks until everything has been written.
[more]size_t copy(ByteStream &bsfrom, size_t size=0)
Copy data from another ByteStream.
[more]void write8(unsigned int card8)
Writes a one-byte integer to a ByteStream.
[more]void write16(unsigned int card16)
Writes a two-bytes integer to a ByteStream.
[more]void write24(unsigned int card24)
Writes a three-bytes integer to a ByteStream.
[more]void write32(unsigned int card32)
Writes a four-bytes integer to a ByteStream.
[more]unsigned int read8()
Reads a one-byte integer from a ByteStream.
[more]unsigned int read16()
Reads a two-bytes integer from a ByteStream.
[more]unsigned int read24()
Reads a three-bytes integer from a ByteStream.
[more]unsigned int read32()
Reads a four-bytes integer from a ByteStream.
[more]virtual int size(void) const
Returns the total number of bytes contained in the buffer, file, etc.


Inherited from GPEnabled:

Public Methods

oGPEnabled& operator=(const GPEnabled & obj)
oint get_count(void) const

Protected Fields

ovolatile int count


Documentation

Read-only ByteStream interface to a memory area. Class StaticByteStream implements a read-only ByteStream interface for a memory area specified by the user at construction time. Calls to function read directly access this memory area. The user must therefore make sure that its content remain valid long enough.
o StaticByteStream(const char *buffer, size_t sz)
Creates a StaticByteStream object for allocating the memory area of length sz starting at address buffer.

o StaticByteStream(const char *buffer)
Creates a StaticByteStream object for allocating the null terminated memory area starting at address buffer.

ovirtual int size(void) const
Returns the total number of bytes contained in the buffer, file, etc. Valid offsets for function seek range from 0 to the value returned by this function.


This class has no child classes.

Alphabetic index HTML hierarchy of classes or Java


DjVu is a trademark of LizardTech, Inc.
All other products mentioned are registered trademarks or trademarks of their respective companies.