james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Richard O. Hammer" <ROHam...@EarthLink.net>
Subject Re: new InputStream class for mail data
Date Wed, 16 Jul 2003 18:52:55 GMT
I attach a revision of the class SMTPDataInputStream which I submit 
for your consideration.  This replaces the version which I mailed to 
this list on July 2.

The external behavior of the code has not changed.  It still passes 
the JUnit tests.

This code should run faster.  I had arranged the code for logical 
clarity as much as for executing speed.  But Noel's comments made me 
realize just how rare would be the case in which this class enters its 
BUFFERING_STATE.  It may never get into that state.  Yet the code was 
testing if(receivedState == BUFFERING_STATE) for every byte read.  Now 
that contingency is handled as a case in a switch, so the most common 
reading of ordinary sequences goes faster.

In addition to the file containing SMTPDataInputStream, I attach once 
again TestSIS.java (a file of JUnit tests).  I also attach two little 
stub classes, for WatchDog and MessageSizeException, which you may 
find useful if you want to compile and test SMTPDataInputStream 
separate from a James installation.

Rich

Mime
View raw message