Skip to Content.
Sympa Menu

xom-interest - Re: [XOM-interest] XOM and Large Files

xom-interest AT lists.ibiblio.org

Subject: XOM API for Processing XML with Java

List archive

Chronological Thread  
  • From: Tatu Saloranta <cowtowncoder AT yahoo.com>
  • To: xom-interest AT lists.ibiblio.org
  • Subject: Re: [XOM-interest] XOM and Large Files
  • Date: Wed, 26 Jul 2006 18:57:24 -0700 (PDT)

--- John Cowan <cowan AT ccil.org> wrote:

> Tatu Saloranta scripsit:
>
> > Reason is that most (all?) parsers I
> > know of buffer their input, so adding
> > BufferedInputStream just adds one unnecessary
> memory
> > copy operation to the chain.
>
> Well, apparently not. Whichever parser Mike is
> using obviously is not
> buffering the InputStream.

Maybe. Or maybe not. ;-)
I can't be sure, but the thing is that if you wrap
InputStreamReader over InputStream, then what happens
is that while parser does do block reads (Xerces
certainly does, like Wolfgang pointed, as do stax ref.
impl. and Woodstox) from Reader, InputStreamReader
itself probably does single byte reads from underlying
InputStream. Thus, damage will be done before parser
has a chance to do anything about it. At least, if my
recollection regarding InputStreamReader
implementation is accurate. And this is where wrapping
InputStream in BufferedInputStream would help
noticeably.

-+ Tatu +-


__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com




Archive powered by MHonArc 2.6.24.

Top of Page