commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Keith R. Bennett" <kbenn...@bbsinc.biz>
Subject RereadableInputStream
Date Thu, 11 Oct 2007 20:35:09 GMT

Hello, all.  I am working with the Apache Tika project.  We found the need to
get a newly opened input stream from the user, and possibly read it multiple
times.  I am aware of the mark and release methods, but we needed to support
streams of arbitrary length, so I thought we'd have to figure something else
out.

I created a class, and I'd like your feedback on it.  If you'd like to
include it, or something based on it, in a future version of your project,
feel free.  Or, if it's a bad idea, or you can suggest modifications or a
totally different approach that would fulfill the need more wisely, please
let me know.

It's called RereadableInputStream.  It saves the bytes read from the
original stream in a byte [], until a user-specified threshold is reached,
then it moves the buffer to a temporary file.

I'm attaching the file and a basic unit test class to this message.  This
version is newer than the one currently in Tika's subversion repository. 
For reasons that I won't bore you with, this version is not yet committed.

Thanks for any help you can offer.

Regards,
Keith Bennett

http://www.nabble.com/file/p13164204/RereadableInputStream.java
RereadableInputStream.java 
http://www.nabble.com/file/p13164204/RereadableInputStreamTest.java
RereadableInputStreamTest.java 
-- 
View this message in context: http://www.nabble.com/RereadableInputStream-tf4609782.html#a13164204
Sent from the Commons - Dev mailing list archive at Nabble.com.


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


Mime
View raw message