Symbian Developer Library

SYMBIAN OS V6.1 EDITION FOR C++

[Index] [Glossary] [Previous] [Next]



Externalising and internalising descriptors


Externalising

Descriptors can be externalised in one of two ways:

The WriteL() member functions of RWriteStream write only the content of a descriptor to the stream; they do not write any length information.

The operator<< is implemented by the Store framework to write both the length of the descriptor content and the content itself to the stream.

Use of the operator<< is preferred because descriptors can then be internalised using either the corresponding operator>> or the variants of HBufC::NewL() or HBufC::NewLC() that take a read stream.

[Top]


Internalising

Descriptors can be internalised in one of three ways:

The ReadL() member functions of RReadStream assume that the stream contains only the content of a descriptor.

Note that the specific variant, ReadL(TDes& aDes), assumes that the length of data to be read from the stream is the same as the maximum length of the target descriptor.

The templated stream operator>> is implemented by the Store framework to read both the length of the descriptor content and the content itself and assumes that the descriptor was originally externalised using the templated operator<<.

The NewLC() and NewL() member functions of HBufC heap descriptors allocate the heap descriptor before internalising from the stream and also assume that the descriptor was originally externalised using the operator<<.