all!
I am using the CryptoStream class, testing with a memoryStream. In the future, we will be using network data, so the stream will be read only and CanSeek = false.
The test data is about 750 bytes. The first 250 bytes are a header and are read OK. The second 250 bytes is the 'real' data. The third 250 bytes are a trailer that contains validation values e.g. hmac for the stream.
Here is a clip of the code. I am at the position 250 and ask CryptoStream.Read to fetch 250 bytes. 250 bytes are returned, but the input position is now at the end of the stream. Any ideas?
byteCount = cs.Read(outputBuffer, 0, bytesToRead)
00005001 inStream.Position = 256
00005002 inStream.Length = 768
00005003 bytesToRead = 256
00005004 bytesLeft = 256
00005010 Invoking cs.Read(outputBuffer, 0, bytesToRead)
00005011 inStream.Position = 768
00005012 inStream.Length = 768
00005013 bytesToRead = 256
00005014 bytesLeft = 0
00005015 byteCount = 256
Thanks in advance for your help!