commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Martin Cooper" <>
Subject RE: File Upload project
Date Tue, 11 Feb 2003 05:28:55 GMT
First of all, you are more likely to receive a timely and helpful response
if you post your questions to the appropriate mailing list, as documented on
the FileUpload web page, rather than to individuals. There is no single
"point person" for Jakarta projects. I am cc'ing the appropriate list on
this reply.

Note that the current code is only looking within a region of the current
buffer, and does not have the entire stream available to search in. The code
you provided appears to be based on having all of the input available.

Nevertheless, if you believe that using this algorithm would provide a
noticeable performance improvement over the existing algorithm, I would
encourage you to submit an enhancement request, as described here:

and provide a patch to the current code.

Martin Cooper

> -----Original Message-----
> From: Ricardo Clements []
> Sent: Monday, February 10, 2003 8:59 PM
> To:;; 
> Subject: File Upload project
> Sorry about emailing to all of you, but not sure who is the point
> person.
> I have just had your project pointed out to me, and having recently
> added multipart support for an internal (pre-struts) servlet 
> framework,
> I took a look at the source.
> One of the areas I think we could improve is the technique for finding
> the next boundry MultipartStream::findSeparator();
> At present the algorithm actually compares every character looking for
> the first char of the boundry string.  This can be very inefficient,
> especially  if the - or multiple ----- exist in a large upload. 
> A simple and very efficient algorithm is the Boyer Moore search
> algorithm (see attachment).  I used this in my implementation when
> scanning the buffer for the start of the boundry string.  The algoritm
> does require some setup but that cost will only be incured once.
> Feel free to use the code if you choose and I would be willing to lend
> a hand if desired.
> Since there is no main in this class you might run it like :
> (new BoyerMooreSearch("Try to say the bay in the day after daylight",
> "ayl")).search();
> This will look for "ayl" in the first arg.  the longer the search
> pattern the more efficient it can be
> Enjoy
> Ricardo Clements
> __________________________________________________
> Do you Yahoo!?
> Yahoo! Shopping - Send Flowers for Valentine's Day

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message