Click here to Skip to main content
15,860,972 members
Home / Discussions / C#
   

C#

 
GeneralRe: Writing and Reading on MemoryStream? Pin
Snowjim19-Apr-05 10:16
Snowjim19-Apr-05 10:16 
GeneralRe: Writing and Reading on MemoryStream? Pin
Scott Serl19-Apr-05 11:35
Scott Serl19-Apr-05 11:35 
GeneralRe: Writing and Reading on MemoryStream? Pin
Snowjim20-Apr-05 3:50
Snowjim20-Apr-05 3:50 
GeneralRe: Writing and Reading on MemoryStream? Pin
Scott Serl20-Apr-05 8:29
Scott Serl20-Apr-05 8:29 
GeneralRe: Writing and Reading on MemoryStream? Pin
Snowjim20-Apr-05 8:40
Snowjim20-Apr-05 8:40 
GeneralRe: Writing and Reading on MemoryStream? Pin
Scott Serl20-Apr-05 11:04
Scott Serl20-Apr-05 11:04 
GeneralRe: Writing and Reading on MemoryStream? Pin
Snowjim20-Apr-05 11:42
Snowjim20-Apr-05 11:42 
GeneralRe: Writing and Reading on MemoryStream? Pin
Scott Serl21-Apr-05 8:22
Scott Serl21-Apr-05 8:22 
Snowjim wrote:
If i have got this 2# right
Then i first need a collection(ArrayList)
int this Collection i will store smal byte arrays like byte[128] or somthing like that.
Then when i have i howl byte buffert(byte[128]) full then i will have to create a new byte array that i write to and place this on the second place in the Collection.


Yes this was my intention. Although, I was thinking of a default size of the byte arrays to be maybe 1024 or 2048 bytes. The performance could be optimized by changing the array sizes to best fit the expected use. My idea is that you want only a few byte arrays at any one time. I think it is much faster to access a byte in a byte array than a member of an arraylist, but I haven't checked. The only performance problem comes when you need to add a new byte array to the arraylist, but if it causes too much performance problem, it could be optomozed with a pre-existing pool of byte arrays which you add or remove from the arraylist.

If using an arraylist provides good enough performance, then use it! Some time later, the performance might not be good enough for a project that needs more speed, so then you optimize your class with a new internal implementation.

Snowjim wrote:
Its important that you can work against this stream as any regular stream. It is posible that it will be connected to controls that reads from streams. Will this be posible if I maintain the override funktion of Stream? like WriteByte(), ReadByte(); and so on?

The stream object inherits from MarshalByRefObject and implements iDisposable, so I don't know what you mean by "connected to controls". Your class should work fine if you have implemented the major stream methods.
GeneralCrystalReports From Pull -> Push Pin
V.18-Apr-05 23:49
professionalV.18-Apr-05 23:49 
GeneralFilling the Textbox Pin
Anonymous18-Apr-05 23:36
Anonymous18-Apr-05 23:36 
Generalplease help me with this Pin
snouto18-Apr-05 23:28
snouto18-Apr-05 23:28 
GeneralRe: please help me with this Pin
S. Senthil Kumar19-Apr-05 0:52
S. Senthil Kumar19-Apr-05 0:52 
GeneralTransparent ListBoxes Pin
zagzagzag18-Apr-05 23:24
zagzagzag18-Apr-05 23:24 
GeneralRe: Transparent ListBoxes Pin
Anonymous19-Apr-05 1:05
Anonymous19-Apr-05 1:05 
GeneralRe: Transparent ListBoxes Pin
Dave Kreskowiak19-Apr-05 4:19
mveDave Kreskowiak19-Apr-05 4:19 
GeneralRe: Transparent ListBoxes Pin
zagzagzag19-Apr-05 9:10
zagzagzag19-Apr-05 9:10 
GeneralMusic Programming Pin
Deniz Oflaz18-Apr-05 23:11
Deniz Oflaz18-Apr-05 23:11 
GeneralRe: Music Programming Pin
pjc*19-Apr-05 3:27
pjc*19-Apr-05 3:27 
GeneralRe: Music Programming Pin
RNEELY19-Apr-05 4:13
RNEELY19-Apr-05 4:13 
GeneralCreating OdbcDataAdapter object with Select statement that has spaces in the fileName Pin
chukkykzn18-Apr-05 22:58
chukkykzn18-Apr-05 22:58 
GeneralHigh CPU usage when using Toolbar Pin
MasudM18-Apr-05 22:24
MasudM18-Apr-05 22:24 
GeneralHelp -- TreeView, How to Sort only a Part of TreeView Nodes Pin
Umair Tariq18-Apr-05 21:18
Umair Tariq18-Apr-05 21:18 
GeneralRe: Help -- TreeView, How to Sort only a Part of TreeView Nodes Pin
CStiefeling19-Apr-05 8:30
CStiefeling19-Apr-05 8:30 
GeneralRe: Help -- TreeView, How to Sort only a Part of TreeView Nodes Pin
Umair Tariq19-Apr-05 20:41
Umair Tariq19-Apr-05 20:41 
GeneralRe: Help -- TreeView, How to Sort only a Part of TreeView Nodes Pin
CStiefeling20-Apr-05 11:59
CStiefeling20-Apr-05 11:59 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.