/** * Reads and discards an entire message. This will read either until EOF or * until an endgroup tag, whichever comes first. */ public void skipMessage() throws IOException { while (true) { final int tag = readTag(); if (tag == 0 || !skipField(tag)) { return; } } }