How to create streams

Write streams

The following code fragment shows how a write stream is created. A write stream is represented by an instance of the
RStoreWriteStream
class and an object of this type can be created on the program stack.

Use the
CreateL()
or
CreateLC()
member function of
RStoreWriteStream
to create a new stream in a store and return its stream ID.

Some stores allow their existing streams to be modified, for example, by overwriting or appending. To open an existing stream for overwriting, use
OpenL()
or
OpenLC()
and identify both the store and the stream:

In this code fragment, the id of the stream must be known before calling
CreateLC()
.

Note that not all store types support the modification of existing streams. An attempt to open an existing stream for modification for these store types will
fail
. A direct file store is an example of a store which does
not
support the modification of existing streams.

Read streams

The following code fragment shows how a read stream is created. A read stream is represented by an instance of the
RStoreReadStream
class and an object of this type can be created on the program stack.

Use the
OpenL()
or
OpenLC()
member function of
RStoreReadStream
to open a stream for reading.