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

Internalize from encrypted file

0 replies · 1,038 views · Started 19 January 2004

Hi Folks!

Can anybody help me?
I want to read an object array from an encrypted file as in the CYPHER demo project.

The object contains only two HBufC variable.
In the internalize method I made this:

void InternalizeL(RReadStream aStream)
{
TBufC<128> buf;

aStream >> buf;
this->SetName(buf);

buf.Clear();

aStream >> buf;
this->SetValue(buf);
}

If the file uses a non encrypted stream (file) it works fine. The last input captures a read error which is TRAPped and the last object is dropped.
However if the file is encrypted, after the last valid input I can read another object with "000000000000" for both name and value and the TRAP comes after that.

If the entry count is even (tested with 6) it's OK but if it's only 5 it gets a buggy 6th entry.

Why is this? Can anybody tell me?

Thanks
Falco