just an update.
Thanks again for all the great suggestions. I created a wrapper class that
used an ArrayList of byte[]'s. I totally removed the MemoryStream from the
method. The memory footprint decreased by over 1/2, and speed increased 3x.
There were alot of other changes that were made, so th
Thanks for the suggestion.
Unfortunately, this app is done in 1.x.
Cheers!
Dave
- Original Message -
From: "Sebastien Lorion" <[EMAIL PROTECTED]>
To:
Sent: Friday, July 07, 2006 8:47 AM
Subject: Re: [ADVANCED-DOTNET] trim byte array
Have you looked at PowerCollec
This clause prevents use with GPL type of license but as far as I
know, there is no problem with LGPL or MIT for example.
Sébastien
On 7/7/06, Barry Kelly <[EMAIL PROTECTED]> wrote:
Sebastien Lorion <[EMAIL PROTECTED]> wrote:
> Have you looked at PowerCollections ?
A caution about PowerCollec
Sebastien Lorion <[EMAIL PROTECTED]> wrote:
> Have you looked at PowerCollections ?
A caution about PowerCollections: it has a bizarre license. In
particular, this term here:
---8<---
In return, we simply require that you agree:
[...]
B. That you are not allowed to combine or distribute the
y footprint.
Once again, thanks all for your feedback.
Cheers!
Dave
- Original Message -
From: "Stoyan Damov" <[EMAIL PROTECTED]>
To:
Sent: Thursday, July 06, 2006 4:13 PM
Subject: Re: [ADVANCED-DOTNET] trim byte array
> Dave,
>
> Are you willing to share with us
moving
>to a dynamically expanding byte array, but the Trimming part is what I
>was/am worried about.
>
>Cheers!
>Dave
>
>
>
>----- Original Message -
>From: "David Lanouette" <[EMAIL PROTECTED]>
>To:
>Sent: Thursday, July 06, 2006 3:37 PM
&g
t the
bytes in the array.
Erick
> -Original Message-
> From: Discussion of advanced .NET topics.
> [mailto:ADVANCED-DOTNET@DISCUSS.DEVELOP.COM ] On Behalf Of Stoyan Damov
> Sent: Thursday, July 06, 2006 5:12 PM
> To: ADVANCED-DOTNET@DISCUSS.DEVELOP.COM
> Subject: Re:
-
> From: Discussion of advanced .NET topics.
> [mailto:[EMAIL PROTECTED] On Behalf Of dave wanta
> Sent: Thursday, July 06, 2006 5:09 PM
> To: ADVANCED-DOTNET@DISCUSS.DEVELOP.COM
> Subject: Re: [ADVANCED-DOTNET] trim byte array
>
> hmmm.. I think you may have mis-under
nt: Thursday, July 06, 2006 5:12 PM
> To: ADVANCED-DOTNET@DISCUSS.DEVELOP.COM
> Subject: Re: [ADVANCED-DOTNET] trim byte array
>
> Gregory was talking about the implementation details of
> List<> which copies the existing items when it grows. On a
> side note, List<*by
looking at adding byte arrays
to the ArrayList, not individual bytes.
Cheers!
Dave
- Original Message -
From: "gregory young" <[EMAIL PROTECTED]>
To:
Sent: Thursday, July 06, 2006 4:49 PM
Subject: Re: [ADVANCED-DOTNET] trim byte array
> An arraylist containi
ng to decrease the memory footprint.
Once again, thanks all for your feedback.
Cheers!
Dave
- Original Message -
From: "Stoyan Damov" <[EMAIL PROTECTED]>
To:
Sent: Thursday, July 06, 2006 4:13 PM
Subject: Re: [ADVANCED-DOTNET] trim byte array
> Dave,
>
> Are y
al Message-
> From: Discussion of advanced .NET topics.
> [mailto:[EMAIL PROTECTED] On Behalf Of
> gregory young
> Sent: Thursday, July 06, 2006 2:50 PM
> To: ADVANCED-DOTNET@DISCUSS.DEVELOP.COM
> Subject: Re: [ADVANCED-DOTNET] trim byte array
>
> An arraylist containing by
his.
Erick
> -Original Message-
> From: Discussion of advanced .NET topics.
> [mailto:[EMAIL PROTECTED] On Behalf Of
> gregory young
> Sent: Thursday, July 06, 2006 2:50 PM
> To: ADVANCED-DOTNET@DISCUSS.DEVELOP.COM
> Subject: Re: [ADVANCED-DOTNET] trim byte array
&g
rk? Simply as a quick prototype?
Cheers!
Dave
- Original Message -
From: "Erick Thompson" <[EMAIL PROTECTED]>
To:
Sent: Thursday, July 06, 2006 3:26 PM
Subject: Re: [ADVANCED-DOTNET] trim byte array
> It's the copy that gets pricey, which is going to be hard to avoid in
@DISCUSS.DEVELOP.COM
Subject: Re: [ADVANCED-DOTNET] trim byte array
dave wanta <[EMAIL PROTECTED]> wrote:
> That would be a good work-around. But, I don't have write access (gotta
love
> all of these constraints. ;-) )
The solution I would use in this scenario is a class I've developed
Dave,
Are you willing to share with us the interface(s) of your component.
If we see how your component's clients will use it, we might be able
to come up with an idea.
Cheers,
Stoyan
On 7/6/06, dave wanta <[EMAIL PROTECTED]> wrote:
I wish I could. But basically these are large blobs (usually
t; <[EMAIL PROTECTED]>
To:
Sent: Thursday, July 06, 2006 7:51 PM
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,
Saad was suggesting that you either build an unmanaged DLL or a
managed C++ wrapper, pass chunks of data to it and get the result when
finished. This however has the following drawbacks, which you might
want to consider before moving to implementation:
- you'll essentially copy all data three tim
, 2006 3:37 PM
Subject: Re: [ADVANCED-DOTNET] trim byte array
> Dave,
>
> Do you really need to keep all the data around? Could you read a few meg,
> then process that data, then read more data and process that, etc... ?
>
> I've found it rare to "have to" deal with
er if even something quick and dirty of an ArrayList of byte arrays
would work? Simply as a quick prototype?
Cheers!
Dave
- Original Message -
From: "Erick Thompson" <[EMAIL PROTECTED]>
To:
Sent: Thursday, July 06, 2006 3:26 PM
Subject: Re: [ADVANCED-DOTNET] trim byte ar
dave wanta <[EMAIL PROTECTED]> wrote:
> That would be a good work-around. But, I don't have write access (gotta love
> all of these constraints. ;-) )
The solution I would use in this scenario is a class I've developed for
a similar purpose. As you may be aware, large objects (i.e. greater than
8
lto:[EMAIL PROTECTED] On Behalf Of dave wanta
> Sent: Thursday, July 06, 2006 4:26 PM
> To: ADVANCED-DOTNET@DISCUSS.DEVELOP.COM
> Subject: Re: [ADVANCED-DOTNET] trim byte array
>
> That would be a good work-around. But, I don't have write
> access (gotta love all of these
That would be a good work-around. But, I don't have write access (gotta love
all of these constraints. ;-) )
Cheers!
Dave
- Original Message -
From: "Barry Kelly" <[EMAIL PROTECTED]>
To:
Sent: Thursday, July 06, 2006 3:20 PM
Subject: Re: [ADVANCED-DOTNET] trim by
essage-
> From: Discussion of advanced .NET topics.
> [mailto:[EMAIL PROTECTED] On Behalf Of
> gregory young
> Sent: Thursday, July 06, 2006 1:00 PM
> To: ADVANCED-DOTNET@DISCUSS.DEVELOP.COM
> Subject: Re: [ADVANCED-DOTNET] trim byte array
>
> Dave this is how list wou
dave wanta <[EMAIL PROTECTED]> wrote:
> It's from a socket, so I don't know the size until i get the terminating
> characters.
You could probably consider streaming it to a temporary file, then,
since I expect a download of many 100s of MB wouldn't be immediate. You
wouldn't want many of those ar
Dave this is how list would work as well ... you can however set an
initial size if you know it to avoid these doublings.
Cheers,
Greg
On 7/6/06, dave wanta <[EMAIL PROTECTED]> wrote:
Hi all,
btw, just fyi...if you Reflector a MemoryStream, it doubles it's internal
buffer every time it exce
ROTECTED]>
To:
Sent: Wednesday, July 05, 2006 7:00 PM
Subject: Re: [ADVANCED-DOTNET] trim byte array
> I don't think you can resize managed arrays.
>
> If its super important, you can keep the byte array in unmanaged space and
call a realloc (or equivalent) on it.
>
> -s
&g
Hi Chris,
I was using a list of primes to dynamically grow the byte array, and keep
track of the length of read data.
Cheers!
Dave
- Original Message -
From: "Chris Anderson" <[EMAIL PROTECTED]>
To:
Sent: Thursday, July 06, 2006 1:21 PM
Subject: Re: [ADVANCED-DOTNET]
Hi Stoyan,
It's from a socket, so I don't know the size until i get the terminating
characters.
Cheers!
Dave
- Original Message -
From: "Stoyan Damov" <[EMAIL PROTECTED]>
To:
Sent: Thursday, July 06, 2006 2:43 PM
Subject: Re: [ADVANCED-DOTNET] trim byte arra
Hi all,
btw, just fyi...if you Reflector a MemoryStream, it doubles it's internal
buffer every time it exceeds it's length.
The MemoryStream is really clean from a programmatic standpoint, it's just
not the performance I really want.
Thanks for all the suggestions guys! I really appreciate it.
AIL PROTECTED]>
To:
Sent: Thursday, July 06, 2006 1:06 PM
Subject: Re: [ADVANCED-DOTNET] trim byte array
> Use a MemoryStream.
>
> Adam..
>
> > -Original Message-
> > From: Discussion of advanced .NET topics. [mailto:ADVANCED-
> > [EMAIL PROTECTED] On Beh
Hi Dave,
Are you reading your data from a fixed storage (e.g. a file, and not
from a socket) and do you know how much bytes you'd need upfront? If
you do then you can preallocate the buffer w/ the exact size you need,
but I guess you don't know the size upfront. If you don't, then I'd
suggest wha
[mailto:[EMAIL PROTECTED] On Behalf Of Saad Rehmani
> Sent: Wednesday, July 05, 2006 8:00 PM
> To: ADVANCED-DOTNET@DISCUSS.DEVELOP.COM
> Subject: Re: [ADVANCED-DOTNET] trim byte array
>
> I don't think you can resize managed arrays.
>
> If its super important, you can k
D]>
Date: Thu, 6 Jul 2006 12:51:24
To:ADVANCED-DOTNET@DISCUSS.DEVELOP.COM
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
that buffer into your large array.
>
> Also, out of interest, how are you dynamically expanding your array?
>
>
> -Original Message-
> From: "dave wanta"<[EMAIL PROTECTED]>
> Sent: 06/07/06 19:01:06
> To: "ADVANCED-DOTNET@DISCUSS.DEVELOP.COM&qu
06/07/06 19:01:06
To: "ADVANCED-DOTNET@DISCUSS.DEVELOP.COM"<
ADVANCED-DOTNET@DISCUSS.DEVELOP.COM>
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
dy
Use a MemoryStream.
Adam..
> -Original Message-
> From: Discussion of advanced .NET topics. [mailto:ADVANCED-
> [EMAIL PROTECTED] On Behalf Of dave wanta
> Sent: Thursday, July 06, 2006 12:51 PM
> To: ADVANCED-DOTNET@DISCUSS.DEVELOP.COM
> Subject: [ADVANCED-DOTNET] trim
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 nul
al Message-
From: "dave wanta"<[EMAIL PROTECTED]>
Sent: 06/07/06 19:01:06
To: "ADVANCED-DOTNET@DISCUSS.DEVELOP.COM"
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 readi
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
40 matches
Mail list logo