return event.type == MAPPING_START && !events.isEmpty() && events.get(0).type == MAPPING_END;
}
private boolean checkEmptyDocument () {
if (event.type != DOCUMENT_START || events.isEmpty()) return false;
Event ev = events.get(0);
return ev.type == SCALAR && ((ScalarEvent)ev).anchor == null && ((ScalarEvent)ev).tag == null
&& ((ScalarEvent)ev).implicit != null && ((ScalarEvent)ev).value.equals("");
}