Let's say I have a WCF method
[OperationContract]
bool UploadFile(Stream stream);
How can I get Seek functionality on stream
?
I need it for two requirements:
- Reading first four bytes of the stream to determine if the file type has
50 4B 03 04
ZIP file signature, and rewinding (stream.Seek(0, SeekOrigin.Begin)
) - Reading a DotNetZip
Ionic.Zip.ZipFile
from Stream:ZipFile zip = ZipFile.Read(stream)
(needs the stream to be seekable)