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.


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)
Returns the offset of the current position in the ByteStream.
[more]virtual int is_seekable(void) const
Tests whether function seek can seek backwards.
[more]virtual void seek(long offset, int whence = SEEK_SET)
Sets the current position for reading or writing the ByteStream.
[more]virtual void flush()
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 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 read32()
Reads a four-bytes integer from a ByteStream.


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.


This class has no child classes.

Alphabetic index HTML hierarchy of classes or Java