ws-soap-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bill-s...@carpenter.ORG (WJCarpenter)
Subject Re: eliminating one or two in memory copies of the response payload
Date Sat, 28 Feb 2004 03:45:59 GMT
sn> One thing I notice.  In B you say "pass a MimeBodyPart
sn> (constructed from a DataSource in turn constructed from the
sn> original SocketInputStream)" and in D you say "where that
sn> InputSource would be constructed from the original
sn> SocketInputStream".  Since you can only read the InputStream once,
sn> you would need to construct the InputSource for D from the part
sn> you created in B.

Yeah, actually it's a little worse than that.  I found out that the
MimeBodyPart stuff reads the content immediately rather than streaming
it in/out as needed (at least I deduce that from clues in the JavaDoc
since I don't have sources for mailapi.jar), and my whole idea is to
avoid reading the stream until the parser does it.

Anyhow, I'll keep casting around until I find some handy class that
does that or maybe make a simple class that starts with a stream and
produces a stream, byte[], or String on demand.  At some logical layer
above that class, I'll make sure nobody needs to read the stream twice
(ie, nobody needs to get the byte[] or String after the stream has
already been read by the XML parser).

I may wail on this if I can get an undistracted few hours over the
next couple weeks.  If I don't make it by then, my guess is I'll never
get to it.
bill@carpenter.ORG (WJCarpenter)    PGP 0x91865119
38 95 1B 69 C9 C6 3D 25    73 46 32 04 69 D6 ED F3

View raw message