I am attempting to create an encrypted zip with a 3rd party crypto library. I've reduced the problem down to a simple example. I am attempting to add a directory and save it to a CryptoStream, but it fails with the CountingStream ctor, because Position is
not available to a CryptoStream. Basically:
using (ICryptoTransform encryptor = _ctx.Algorithm.CreateEncryptor())
using (FileStream outputStream = GetWriteableFileStream(_outputFilename))
using (CryptoStream cryptoStream = GetWriteCryptoStream(outputStream, encryptor))
using (ZipFile zip = new ZipFile())
The problem is, I get an exception that the stream does not support seeking. Reading the documentation at http://cheeso.members.winisp.net/DotNetZipHelp/html/8b981f77-742a-5f47-6299-c27104871d8c.htm
suggests that this is possible. Should CountingStream check Stream.CanSeek before trying to read Stream.Position?
Thanks for any help you can offer.