Home > Language Reference > Classes > StreamComposite

Add Method

Adds a stream into the collection.

Syntax

Public Sub Add(ByRef objStream As Stream, Optional ByVal lOffset As Long = 0, Optional ByVal lSize As Long = -1)

ParameterDescription
objStreamStream to add.
lOffsetOffset of the chunk to add to the collection.
lSizeSize of the chunk to add to the collection.

Remarks

The Add method adds a stream into the collection of a StreamComposite object. You must insert at least one stream in the collection before you can start reading data. As any other collection, the StreamComposite object cannot contain more than 4096 elements.

The objStream parameter is a reference to the stream to add. This stream must be properly initialized (for example, if it is a StreamFile object, the file must be opened), it must be readable, and calling its Position and Size properties must be allowed (which excludes for example StreamSerial or StreamSocket objects). Note that the same stream can be added several times.

The optional lOffset and lSize parameters let you specify that only a portion of the stream must be added into the collection. If specified, the chunk they delimit must be entirely contained in the stream, otherwise a runtime error occurs. If not specified, the whole stream content is added.

This method does not actually read nor copy any data. Only a reference to the stream and the value of the lOffset and lSize parameters are stored.

System requirements

SystemMinimal versionRemarks
Palm OSPalm OS 3.0N/A