commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Christopher (siege) "OBrien <si...@preoccupied.net>
Subject [IO] CallbackOutputStream (sort-of a proposal)
Date Thu, 24 Apr 2003 21:02:31 GMT

Hello,

I've been working on a set of classes which might have a place within
commons (in io, probably). I'm just looking for feedback on the idea
before I write more than the simple implementation I've got thus far.

I've got what looks like an output stream, created with a fixed-size
internal buffer, and a slot for a listener. The listener implements an
interface I'm calling ByteSequenceProcessor, and has a  public method
process(ByteSequence):void. ByteSequence is very similar to
CharSequence, except it's an interface and (you guessed it) based on
bytes.

The point behind this mess is to allow input to be passed into the
stream, and the stream will automatically trigger the sequence processor
when necessary, passing ByteSequences of the correct size. It eliminates
the necessity for duplicate chunking code.

I wrote this as part of an MD5 implementation for codec (hopefully for
codec) a little while ago. I'd appreciate any feedback on the idea and
its (possible lack of) merit.


Thanks,
Chris

-- 
Christopher (siege) O'Brien <siege@preoccupied.net>
http://preoccupied.net/~siege/

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message