tagged [memorystream]
How to remove data from a MemoryStream
How to remove data from a MemoryStream I cannot get this to work. I have a MemoryStream object. This class has a Position property that tells you how many bytes you have read. What I want to do is to ...
- Modified
- 10 May at 18:17
convert string to memory stream - Memory stream is not expandable?
convert string to memory stream - Memory stream is not expandable? i was trying to write a string to a memory stream, but failed with the error message: the line of code that produces this problem: an...
- Modified
- 11 Nov at 16:50
StreamWriter writing to MemoryStream
StreamWriter writing to MemoryStream I was under the impression that when you called `Flush()` in a StreamWriter object it writes to the underlying stream, but apparently this isn't the case with my c...
- Modified
- 21 Jun at 22:8
Copy MemoryStream to FileStream and save the file?
Copy MemoryStream to FileStream and save the file? I don't understand what I'm doing wrong here. I generate couple of memory streams and in debug-mode I see that they are populated. But when I try to ...
- Modified
- 4 Nov at 20:15
Writing a memory stream to a file
Writing a memory stream to a file I have tried retrieving data in the json format as a string and writing it to a file and it worked great. Now I am trying to use MemoryStream to do the same thing but...
- Modified
- 17 Aug at 15:47
Does a MemoryStream get disposed of automatically when returning it as an ActionResult?
Does a MemoryStream get disposed of automatically when returning it as an ActionResult? ``` public ActionResult CustomChart(int reportID) { Chart chart = new Chart(); // Save the chart to a Memory...
- Modified
- 3 May at 08:52
MemoryStream: why convert to byte after readByte
MemoryStream: why convert to byte after readByte In [this example from MS](http://msdn.microsoft.com/en-us/library/system.io.memorystream.aspx), you'll notice that after we read a byte from memory str...
- Modified
- 19 Aug at 20:23
Read ionic Zip as Memory Stream C#
Read ionic Zip as Memory Stream C# I am using Ionic.Zip to extract ZipFile to memory stream with this method: ``` private MemoryStream GetReplayZipMemoryStream() { MemoryStream zipMs = new MemoryStr...
- Modified
- 28 Apr at 07:4
Stream.CopyTo not copying any stream data
Stream.CopyTo not copying any stream data I'm having an issue with copying data from a `MemoryStream` into a `Stream` inside a `ZipArchive`. The following is NOT working - it returns only 114 bytes: `...
- Modified
- 4 Aug at 15:29
Writing a Text File in memory and saving it with savefiledialog
Writing a Text File in memory and saving it with savefiledialog I am trying to make a text file in memory, add some lines to it and at the end save the file in a text file. I can handle the savedialog...
- Modified
- 8 Nov at 08:56
Does a Stream get Disposed when returning a File from an Action?
Does a Stream get Disposed when returning a File from an Action? I'm writing a string to a `MemoryStream` I need to return the stream to the Controller Action so I can send it off as a file for downlo...
- Modified
- 20 Nov at 21:39
Writing to MemoryStream with StreamWriter returns empty
Writing to MemoryStream with StreamWriter returns empty I am not sure what I am doing wrong, have seen a lot of examples, but can't seem to get this working. ``` public static Stream Foo() { var mem...
- Modified
- 25 Feb at 20:7
Use MemoryStream and ZipArchive to return zip file to client in asp.net web api
Use MemoryStream and ZipArchive to return zip file to client in asp.net web api I am trying to return zip file from asp.net web api to client using The following Code: ``` private byte[] CreateZip(str...
- Modified
- 30 May at 19:12
Reading from memory stream to string
Reading from memory stream to string I am trying to write an object to an Xml string and take that string and save it to a DB. But first I need to get the string... ``` private static readonly Encodin...
- Modified
- 13 Dec at 09:54
Name cannot begin with the ' ' character
Name cannot begin with the ' ' character I'm parsing some XML in C#. I'm getting it from a database, and so converting it to a MemoryStream before reading it with an XmlTextReader. The problem is that...
- Modified
- 17 Feb at 16:35
Serializing/deserializing with memory stream
Serializing/deserializing with memory stream I'm having an issue with serializing using memory stream. Here is my code: ``` /// /// serializes the given object into memory stream /// /// the object to...
- Modified
- 10 Jan at 05:22
XML writer and Memory Stream c#
XML writer and Memory Stream c# I am creating a file using XmlWriter, `XmlWriter writer = XmlWriter.Create(fileName);` it is creating a file and then i have one more function which i am calling `priva...
- Modified
- 11 Oct at 20:46
Is there an in memory stream that blocks like a file stream
Is there an in memory stream that blocks like a file stream I'm using a library that requires I provide an object that implements this interface: The object's readers then get used by the library with...
- Modified
- 25 Sep at 06:33
Convert from a DataUrl to an Image in C# and write a file with the bytes
Convert from a DataUrl to an Image in C# and write a file with the bytes Hello I have signature like this: ![enter image description here](https://i.stack.imgur.com/6FjbW.png) which is encoded to a Da...
- Modified
- 30 Nov at 22:6
How am I supposed to use ZipArchive with memory streams?
How am I supposed to use ZipArchive with memory streams? My problem is that as soon as `ZipArchive` is disposed, it automatically closes and disposes the `MemoryStream`. If I look at the stream before...
- Modified
- 17 Oct at 15:9
Why does C# memory stream reserve so much memory?
Why does C# memory stream reserve so much memory? Our software is decompressing certain byte data through a `GZipStream`, which reads data from a `MemoryStream`. These data are decompressed in blocks ...
- Modified
- 8 Jul at 15:48
How to read a binary file quickly in c#? (ReadOnlySpan vs MemoryStream)
How to read a binary file quickly in c#? (ReadOnlySpan vs MemoryStream) I'm trying to parse a binary file as fastest as possible. So this is what I first tried to do: ``` using (FileStream filestream ...
- Modified
- 27 Dec at 05:34
Image.FromStream() method returns Invalid Argument exception
Image.FromStream() method returns Invalid Argument exception I am capturing images from a smart camera imager and receiving the byte array from the camera through socket programming (.NET application ...
- Modified
- 9 Oct at 10:22
Getting PdfStamper to work with MemoryStreams (c#, itextsharp)
Getting PdfStamper to work with MemoryStreams (c#, itextsharp) It came to me to rework old code which signs PDF files into new one, which signs MemoryStreams (byte arrays) that come and are sent by we...
- Modified
- 2 Jan at 22:30
What is the difference between calling Stream.Write and using a StreamWriter?
What is the difference between calling Stream.Write and using a StreamWriter? What is the difference between instantiating a `Stream` object, such as `MemoryStream` and calling the `memoryStream.Write...
- Modified
- 21 May at 12:52