Re: [Beepcore-java-users] sending files in messages
Status: Beta
Brought to you by:
huston
|
From: Huston <hu...@us...> - 2002-05-28 04:13:16
|
> I am working on a class called OutputDataStreamAdapter extends > java.io.OutputStream. It would be accessed from OutputDataStream by method > getOutputStream. This is analogous to the InputDataStream.getInputStream() > returning a java.io.InputStream extended InputDataStreamAdapter. I expect > to submit this code back to the project sometime in the near future Thanks! > The mime headers are a different beast. They seem to be in a funny place to > me as well, in the subclasses. For example, they are settable in > StringDataOutputStream and ByteDataOutputStream. [aside: I am working from > memory here, so my class names might be a bit off. I assume you know which > ones I am talking about]. I found myself in a similiar boat as you, that in > order to test my code, I had to create a class called > SettableDataOutputStream, just so I could default the MimeHeaders. > > To be honest, I don't quite understand what/why the MimeHeaders are > neccesary in *all* cases anyway. But I haven't taken the time yet to > investigate either. > > Huston may have some reason for this scheme, so hopefully he will enlighten > us. When I started the new DataStreams the idea was that InputDataStream and OutputDataStream would be the low-level DataStreams. By low-level I mean that they would provide an interface that is very basic (e.g. wouldn't have any support for mime headers) and easy/efficient to use in building the core library. InputDataStreamAdapter, StringOutputDataStream, ByteOutputDataStream, etc.were intended to provide a higher level interface including support for mime headers. There were a couple of cases where it made the code much easier if the low-level DataStreams had limited knowledge of the mime headers being used by the derived classes. So I added the code but didn't make it public because I was trying to keep the low-level DataStreams interfaces simple. Also I thought most people would be using the high-level DataStreams, I imagine it would have helped if I had written the OutputDataStreamAdapter at the same time. Anyway, that is the history behind the code. While the code is better than the previous version it could probably use some refactoring. So let me know if you have any suggestions as you are using it. --Huston |