Linked Questions
13 questions linked to/from .NET Asynchronous stream read/write
576 votes
13 answers
393k views
How do I copy the contents of one stream to another?
What is the best way to copy the contents of one stream to another? Is there a standard utility method for this?
83 votes
4 answers
92k views
C# FileStream : Optimal buffer size for writing large files?
Suppose I'm writing a couple of files to disk, between 2MB and 5GB. What are sensible buffer values for the FileStream ? Is it sensible to work with buffersizes of several megabytes, or should I ...
36 votes
1 answer
28k views
How to use Stream.CopyTo on .NET Framework 3.5?
I found upload code and this code contains the Stream.CopyTo method. Example: file.Stream.CopyTo(requestStream); // .NET Framework 4.0 How can I copy "file.Stream" to "requestStream"?
20 votes
3 answers
10k views
ASP.NET Web API 2 - StreamContent is extremely slow
We've ported a project from WCF to Web API (SelfHost) and during the process we noticed a huge slowdown when serving out a web application. Now 40-50 seconds vs 3 seconds previously. I've reproduce ...
6 votes
1 answer
15k views
Streaming with WCF and MTOM
I am using WCF bindings with streamed transfer mode, for both uploading and downloading binary content to/from a service. I've managed to get it working. I'll include the configuration, contracts, etc ...
7 votes
4 answers
3k views
Is Stream.Copy piped?
Suppose I am writing a tcp proxy code. I am reading from the incoming stream and writing to the output stream. I know that Stream.Copy uses a buffer, but my question is: Does the Stream.Copy method ...
5 votes
2 answers
6k views
Asynchronous Reading/Writing to same stream?
Occasionally we need to copy huge files from one bucket to another in AWS S3. Whenever possible we use the CopyRequest to handle this operation all on AWS (since no round trip required back to the ...
6 votes
2 answers
2k views
Can starting multiple asyncronous read/write operations on the same Stream corrupt the data?
I'm using asynchronous I/O because it does not block the calling thread and does the threading stuff behind the scenes. If I invoke multiple async operations like BeginWrite()'s on the same Stream, ...
4 votes
1 answer
3k views
Download file to client asynchronously
I'm having a hard time getting something done. I am building an mailclient using asp.net MVC 4. I am at the point that i have to download an image related to a message ( NOT an attachment ) to the ...
1 vote
1 answer
3k views
C#: How to set AsyncWaitHandle in Compact Framework?
I'm using a TcpClient in one of my Compact Framework 2.0 applications. I want to receive some information from a TCP server. As the Compact Framework does not support the timeout mechanisms of the "...
0 votes
2 answers
2k views
how to copy one Stream object values to second Stream Object in asp.net
In my project user can upload file up to 1GB. I want to copy that uploaded file stream data to second stream. If I use like this int i; while ( ( i = fuVideo.FileContent.ReadByte() ) != -1 ) { ...
0 votes
1 answer
205 views
killing process used by vb.net
I need some help with my program. I want to rewrite the data on my .txt file but an error occurs: The process cannot access the file 'C:\Users\AARVIII\Documents\Visual Studio 2010\Projects\PROJECT\...
-1 votes
1 answer
66 views
Connect WriteTo Stream and ReadFrom Stream methods
I have two methods from two different third party libraries: Task WriteToAsync(Stream stream); Task LoadAsync(Stream stream); I need to pipe data from source WriteTo method to Load method. Currently ...