Re: [Beepcore-java-users] API changes - DataStreams
Status: Beta
Brought to you by:
huston
From: Huston <hu...@us...> - 2001-11-13 17:40:40
|
> I've just started incorporating the changes in the streams stuff into > the app I am working on and thought now might be a good time to bring up > a few things. I'll assume the current cvs tree might not yet be > complete? Yes, the code in cvs is a work in progress. > (1) OutputDataStream - a helpful addition would be able to treat the > OutputDataStream as if it were a java.io.OutputStream. In one case, I > XSLT transform a document to an java.io.OutputStream, it would make > sense to parse to the output stream used by the sendMSG. From an API > viewpoint, a constructor along the lines of > OutputDataStream(java.io.OutputStream) would be nice. I was planning on having a sub-class of OutputDataStream in the lib package that would provide this functionality. I haven't implemented this yet because to do it correctly I need one of the fixes I'm currently working on. > In another point in my app, I send a file as the payload of a message. > Under the current cvs, I believe I would need to read this file into a > byte[] and then use the byte[] to construct a ByteDataStream. In this > case I would rather buffer read the file and write to an > OutputDataStream. The sendMSG would pump the data until the > OutputDataStream were closed (or setComplete()). The old > org.beepcore.beep.core.FileDataStream was actually great for this. I'm planning on adding a new FileOutputDataStream as well as InputStreamOutputDataStream (this needs a new name, suggestions are welcome) in the lib package. --Huston |