memorystream

c# Read from huge MemoryStream

I use a BinaryReader(MemoryStream(MyByteArray))) to read variable sized records and process them all in memory. This works well as long as my bytestream which is in the array is less than about 1.7G in size. After that (which is the maximum size of an integer in my 64bit system) you cannot create a larger bytearray, although I have enoug...

c# MemoryStream

I have an extreamely large 2D bytearray in memory. byte MyBA = new byte[int.MaxValue][10]; is there any way (probably unsafe) that I can fool c# into thinking this is one huge continuous bytearray? I want to do this such that I can pass it to a MemoryStream and then a BinaryReader. MyReader = new BinaryReader(MemoryStream(*MyBA)) //Sy...

Regarding performance issues for usage of memory stream in c#

I created one project. Many persons will use my project at a time. If any person got error then it will write to a file by creating object using memory stream. If everybody get errors, then that number of objects will be created and all objects are writing error to the same file at a time. Is there any problems and performance issues wi...

usage of memory stream

when will we use memory stream? ...

create file and save to it using memorystream

Hi, How can i create a file and write to it using the memory stream? I need to use the memorystream to prevent other threads from trying to access the file. The data i'm trying to save to a file is html. How can this be done? ...

How to write Linq Binary type to MemoryStream and vice versa

Hi, I'm going to write System.Data.Linq.Binary value to MemoryStream and perform some manipulations, then re-write new values from MemoryStream to Binary! how to do? Thanks in advance ;) ...

Error loading Bitmap from MemoryStream

I'm trying to load images (pdfs and Word documents) from a memory stream so I can manipulate them before they get added to a pdf. Whenever I try and load a bitmap or a GIF I get one of the dreaded GDI+ errors. This call... System.Drawing.Bitmap myImage = System.Drawing.Image.FromStream(docStream); Generates this error... Sys...

Inconsistent behavior when saving a PNG to Response.OutputStream

This question is related this one: http://stackoverflow.com/questions/582766/cannot-render-image-to-httpcontext-response-outputstream. It is not a duplicate. When attempting to save a PNG to the Response.OutputStream I am experiencing inconsistent behavior between the local development environment and the production environment. Namely,...

How do I store arbitrary binary data in a binary serialized class?

Using C#/.NET for my application, I've got a series of classes in my main data model that represent "binary" (as opposed to text) content. I've got a inheritance setup like this: Basically, the abstract class BinaryContent contains a MemoryStream that stores arbitrary binary data. That data is read from a file on disk. Each type of bi...

array of ByteArray into MemoryStream

I have a method which returns a array of ByteArray: public byte[][] Draw(ImageFormat imageFormat, ImageSize imageSize); and I need to write it into a MemoryStream: var byteArray = instanceName.Draw(ImageFormat.Jpeg, ImageSize.Dpi150); MemoryStream ms = new MemoryStream(byteArray[0]); This is working so far because the array of byte...