c# Programming Glossary: input.read
What is the best buffer size when using BinaryReader to read big files (>1GB)? http://stackoverflow.com/questions/19558435/what-is-the-best-buffer-size-when-using-binaryreader-to-read-big-files-1gb input byte buffer new byte 16 1024 int read while read input.Read buffer 0 buffer.Length 0 ...... Obviously the buffer size 16..
Creating a byte array from a stream http://stackoverflow.com/questions/221925/creating-a-byte-array-from-a-stream MemoryStream ms new MemoryStream int read while read input.Read buffer 0 buffer.Length 0 ms.Write buffer 0 read return ms.ToArray..
Best way to copy between two Stream instances http://stackoverflow.com/questions/230128/best-way-to-copy-between-two-stream-instances output byte buffer new byte 32768 int read while read input.Read buffer 0 buffer.Length 0 output.Write buffer 0 read share..
How do you stream an Excel 2007 or Word 2007 file using asp.net and c# http://stackoverflow.com/questions/2519026/how-do-you-stream-an-excel-2007-or-word-2007-file-using-asp-net-and-c-sharp output byte buffer new byte 32768 while true int read input.Read buffer 0 buffer.Length if read 0 return output.Write buffer..
Convert a Stream to a FileStream in C# http://stackoverflow.com/questions/3769067/convert-a-stream-to-a-filestream-in-c-sharp byte buffer new byte 8192 int bytesRead while bytesRead input.Read buffer 0 buffer.Length 0 ret.Write buffer 0 bytesRead Rewind..
How do I save a stream to a file? http://stackoverflow.com/questions/411592/how-do-i-save-a-stream-to-a-file output byte buffer new byte 8 1024 int len while len input.Read buffer 0 buffer.Length 0 output.Write buffer 0 len To use..
How to read a text file reversely with iterator in C# http://stackoverflow.com/questions/452902/how-to-read-a-text-file-reversely-with-iterator-in-c-sharp bytesToRead int index 0 while index bytesToRead int read input.Read buffer index bytesToRead index if read 0 throw new EndOfStreamException..
how to pass html as a string using wkhtmltopdf? http://stackoverflow.com/questions/4651373/how-to-pass-html-as-a-string-using-wkhtmltopdf output byte buffer new byte 32768 int read while read input.Read buffer 0 buffer.Length 0 output.Write buffer 0 read share..
How to use Stream.CopyTo on .NET Framework 3.5? http://stackoverflow.com/questions/5730863/how-to-use-stream-copyto-on-net-framework-3-5 1024 Fairly arbitrary size int bytesRead while bytesRead input.Read buffer 0 buffer.Length 0 output.Write buffer 0 bytesRead ..
How to use the 7z SDK to compress and decompress a file http://stackoverflow.com/questions/7646328/how-to-use-the-7z-sdk-to-compress-and-decompress-a-file Read the decoder properties byte properties new byte 5 input.Read properties 0 5 Read in the decompress file size. byte fileLengthBytes.. the decompress file size. byte fileLengthBytes new byte 8 input.Read fileLengthBytes 0 8 long fileLength BitConverter.ToInt64 fileLengthBytes..
Httplistener and file upload http://stackoverflow.com/questions/8466703/httplistener-and-file-upload FileAccess.Write Byte buffer new Byte 1024 Int32 len input.Read buffer 0 1024 Int32 startPos 1 Find start boundary while true.. buffer len boundaryLen buffer 0 boundaryLen len input.Read buffer boundaryLen 1024 boundaryLen Skip four lines Boundary.. n 0 startPos if startPos 0 startPos break else len input.Read buffer 0 1024 Array.Copy buffer startPos buffer 0 len startPos..
Write file from assembly resource stream to disk http://stackoverflow.com/questions/864140/write-file-from-assembly-resource-stream-to-disk byte buffer new byte 8192 int bytesRead while bytesRead input.Read buffer 0 buffer.Length 0 output.Write buffer 0 bytesRead then..
how to write super fast file streaming code in C#? http://stackoverflow.com/questions/955911/how-to-write-super-fast-file-streaming-code-in-c throw an exception while length 0 bytesRead 0 bytesRead input.Read buffer 0 Math.Min length buffer.Length output.Write buffer.. throw an exception while length 0 bytesRead 0 bytesRead input.Read buffer 0 Math.Min length buffer.Length output.Write buffer..
Embedding one dll inside another as an embedded resource and then calling it from my code http://stackoverflow.com/questions/96732/embedding-one-dll-inside-another-as-an-embedded-resource-and-then-calling-it-fro int readLength var buffer new byte 4096 do readLength input.Read buffer 0 buffer.Length output.Write buffer 0 readLength while..
|