public BTXEvent next() throws IOException {
		ParseEventData cur = eventStack;
		if (cur == null) {
			// If there's nothing left in the stack, we're at the end of the file!
			return BTXEvent.EOF;
		}
		
		if (cur.attrsLeft > 0) {
			cur.attrsLeft--;
			cur.curAttr = BTXHelp_0.readAttribute(f);
			return BTXEvent.ATTRIBUTE;
		}
		if (cur.objsLeft == 0) {
			// Out of children and done with the current object!
			eventStack = eventStack.par;
			return eventStack == null ? BTXEvent.EOF : BTXEvent.END_OBJECT;
		} else { // cur.objsLeft > 0
			// Start reading a new object
			eventStack.curAttr = null; // Clear last curAttr
										// (don't need to do this really, but we should)
			cur.objsLeft--;
			eventStack = new ParseEventData(eventStack, // push it to the top of the stack
					BTXHelp_0.readString(f), // Name
					BTXHelp_0.read32BitUnsigned(f), // Attribute count
					BTXHelp_0.read32BitUnsigned(f)); // Object count
			return BTXEvent.START_OBJECT;
		}
	}