Linked Questions

576 votes
13 answers
393k views

What is the best way to copy the contents of one stream to another? Is there a standard utility method for this?
Anton's user avatar
  • 6,990
83 votes
4 answers
92k views

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 ...
Pygmy's user avatar
  • 1,886
36 votes
1 answer
28k views

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"?
Mennan's user avatar
  • 4,507
20 votes
3 answers
10k views

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 ...
TommyN's user avatar
  • 2,401
6 votes
1 answer
15k views

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 ...
Yiğit Yener's user avatar
  • 6,006
7 votes
4 answers
3k views

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 ...
Israel Lot's user avatar
5 votes
2 answers
6k views

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 ...
snappymcsnap's user avatar
  • 2,113
6 votes
2 answers
2k views

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, ...
Calmarius's user avatar
  • 19.7k
4 votes
1 answer
3k views

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 ...
Roy Scheefhals's user avatar
1 vote
1 answer
3k views

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 "...
Thorsten Dittmar's user avatar
0 votes
2 answers
2k views

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 ) { ...
munish's user avatar
  • 1
0 votes
1 answer
205 views

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\...
aarviii's user avatar
  • 13
-1 votes
1 answer
66 views

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 ...
Oleg Oshkoderov's user avatar