Brian J. Sayatovic
Usenet Archive
- Joined
- Jun 9, 2000
- Messages
- 52
- Reaction score
- 0
I have a need to adapt a JDOM Document to an InputStream. I am building the Document in memory, but then need to serve it via a Java Activation Framework DataSource which deals in InputStreams. Normally, JDOM prefers to write to OutputStreams directly, but that will not fit this case.
Currently, I'm writing the whole Document to a ByteArrayOutputStream and then using the generated byte to back a ByteArrayInputStream. This is a lot of extra work that is consuming memory and wasting time.
I can vaguely conceive of how to write my own adapter, but I was hoping someone else has already tackled this.
Any ideas?
Regards,
Brian.
Currently, I'm writing the whole Document to a ByteArrayOutputStream and then using the generated byte to back a ByteArrayInputStream. This is a lot of extra work that is consuming memory and wasting time.
I can vaguely conceive of how to write my own adapter, but I was hoping someone else has already tackled this.
Any ideas?
Regards,
Brian.