Logging Question

A

Arved Sandstrom

[ SNIP ]
new Enumeration() {

int index = 0;
InputStream streams[] = new InputStream[] {bsBegin, in, bsEnd};

@Override
public boolean hasMoreElements() {
return index < streams.length;
}

@Override
public Object nextElement() {
return streams[index++];
}

});

Perhaps easier to do Collections.enumeration(Arrays.asList(bsBegin, in,
bsEnd)).

No perhaps about it! Thanks for reminding me of that method. I need to
make time to review core APIs every so often.
Yes, good trick. As a general pattern (topping and tailing some stream
of items with start-container and end-container markers), it's useful in
all sorts of places. Admittedly most when dealing with XML.


Is there any support for getting parsers to parse multiple fragments
from a single stream? If not, we're back to needing to frame the stream
in some way, and then we might as well parse it as a sequence of
documents. I'm pretty hazy on what the point of document fragments is,
really.

tom
In the formal sense I'm not sure I see the point of them either.
Apparently neither does W3C.

AHS
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Logging 0
Logging problem 32
Additional logging questions 17
Java Logging Question 24
Making a logging handler that produces context. 0
Logging - Best Practices 4
python logging module:a quick question 0
Logging 9

Members online

Forum statistics

Threads
473,777
Messages
2,569,604
Members
45,217
Latest member
IRMNikole

Latest Threads

Top