you have two options I believe.
1. use a seaprate index to track location in byte array.
2. change the code for the dynamically expanding array (or create your own) to 
internally track this.

unless you use a method of tracking the length, any other method you use will 
prob copy. I believe for instance.... trimming a string effectively creates a 
new string in memory an interns it... so the same would happen with your aray.

-----Original Message-----
From: dave wanta <[EMAIL PROTECTED]>
Sent: Thu, 06 July 2006 17:51:24
To: [email protected]
Subject: [ADVANCED-DOTNET] trim byte array

hi all,
does anyone know of an efficient way to trim a byte array?

Here is what is happening. I'm reading in some binary data into a
dynamically expanding byte array, until all of the data has been read into
memory. I need to trim the byte array to remove the trailing nulls. Because
the amount of data is large (100megs+), I don't want to simply create a 2nd
100meg+ byte array in memory, and then copy it. So, is there anyway to trim
the existing byte array, and then return it?

Thanks,
Dave

===================================
This list is hosted by DevelopMentorĀ®  http://www.develop.com

View archives and manage your subscription(s) at http://discuss.develop.com

-------------------------------------------------
 Sent using http://www.DWmail.net, a free service
 Check your email [any email, anytime, anywhere]
-------------------------------------------------
Disclaimer: DWmail.net is not responsible for the content sent via it's 
services.  Additional header information is included regarding the source of an 
email.  If you believe an email is junk you should look for the 'Originating 
IP' message header

===================================
This list is hosted by DevelopMentorĀ®  http://www.develop.com

View archives and manage your subscription(s) at http://discuss.develop.com

Reply via email to