* secondly, to handle (optional) flattening output.
*/
protected boolean loadMore()
throws XMLStreamException
{
WstxInputSource input = mInput;
// Any flattened not-yet-output input to flush?
if (mFlattenWriter != null) {
/* Note: can not trust mInputPtr; may not be correct. End of
* input should be, though.
*/
mFlattenWriter.flush(mInputBuffer, mInputEnd);
}
do {
/* Need to make sure offsets are properly updated for error
* reporting purposes, and do this now while previous amounts
* are still known.
*/
mCurrInputProcessed += mInputEnd;
mCurrInputRowStart -= mInputEnd;
try {
int count = input.readInto(this);
if (count > 0) {
if (mFlattenWriter != null) {
mFlattenWriter.setFlattenStart(mInputPtr);
}
return true;
}
input.close();
} catch (IOException ioe) {
throw constructFromIOE(ioe);
}
if (input == mRootInput) {
return false;
}
WstxInputSource parent = input.getParent();
if (parent == null) { // sanity check!
throwNullParent(input);
}
/* 13-Feb-2006, TSa: Ok, do we violate a proper nesting constraints
* with this input block closure?