I have function with streams(one for input and another for output) as parametrs. It is cryptographic fucnction so streams can be very big. But stream, that function need is not a whole file it is file field.So, how I can put file field(it may be very big so no MemoryStreams etc.) in stream? Sorry for my bad english.
I have function with streams(one for input and another for output) as parametrs. It
Share
If you mean you meed to supply a Stream that is a part of a file (or any other Stream) then you typically would use one of two approaches:
The first is useful if you need to pass that Stream to pre-existing code / libraries.
In both cases, IMO the code that sets up the stream should worry about the “before” data, with the above just worrying about not reading too much.
Edit: here’s one I wrote earlier: http://protobuf-net.googlecode.com/svn/branches/v1/protobuf-net/SubStream.cs