Read-only archive of the All About Symbian forum (2001–2013) · About this archive

Encrypted streaming error

0 replies · 1,088 views · Started 20 January 2004

Hi All!

I found a strange thing.

I want to read entries from a file with a RReadStream.
The entry contains a name and a value field.

If the file isn't encrypted it works fine. I saved five items to the file and I can read five items back.
However the encryption ruins this. After the fifth item I can read another element with '000000000000' to both name and value.

Why is this?
The internalizing runs until the stream leaves. I capture the leave with a TRAP. If the constructor returns a NULL pointer the import is done.

Here is the internalizing:

void MyItem::InternalizeL(RReadStream& aStream)
{
TBuf<KBufSize> buf;

//Name
aStream >> buf;
this->SetNameL( buf );

buf.Zero();

//Value
aStream >> buf;
this->SetValueL( buf );
}

The leaving is captured in the calling method.

Any idea?

Thanks
Falco