You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by Ricardo Clements <rc...@yahoo.com> on 2003/02/12 00:43:13 UTC

[Patch] for MultipartStream.java of FileUpload project

Suggestion for improving the MultipartStream::findSeparator() method.

I am proposing that the algorithm be changed to utilize the Boyer Moore
pattern matching algorithm. For a nice animated explanation of the
algorithm follow 

http://www.cs.utexas.edu/users/moore/best-ideas/string-searching/fstrpos-example.html

I have added a member to the class <code>int[] shift</code>, added a
<code>prepareBoundarySearch()</code> method and altered the
<code>findSeparator()</code> method to use this algorithm.  The
prepareBoundarySearch method is called in the constructor and in the
setBoundary(...) methods.

sorry I do not have or know cvs, so i have just attached the altered
class file

Ricardo Clements
ricardo.clements@conceptrendering.com

__________________________________________________
Do you Yahoo!?
Yahoo! Shopping - Send Flowers for Valentine's Day
http://shopping.yahoo.com