Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I am using MemoryStream to store a report. But the MemoryStream won't store the report if the size of the report is more than 70000. So I should increase the size of the MemoryStream in that case. How can I increase the size of the MemoryStream?

say for example,

mstream=new MemoryStream();
stream.copyTo(mstream); // Here stream contains the report
mstream.position=0;

In this case how can I increase the capacity of MemoryStream so that it can store even if the report size is more than 7000. Please help as I am a beginner in C#.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
185 views
Welcome To Ask or Share your Answers For Others

1 Answer

you should use

MemoryTributary d = new MemoryTributary();
 int a = d.ReadByte();  
 d.SetLength(10000);  
int b = d.ReadByte();

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...