@@ -224,13 +224,35 @@ public abstract boolean skipField(final int tag, final CodedOutputStream output)
224224 * Reads and discards an entire message. This will read either until EOF or until an endgroup tag,
225225 * whichever comes first.
226226 */
227- public abstract void skipMessage () throws IOException ;
227+ public void skipMessage () throws IOException {
228+ while (true ) {
229+ final int tag = readTag ();
230+ if (tag == 0 ) {
231+ return ;
232+ }
233+ boolean fieldSkipped = skipField (tag );
234+ if (!fieldSkipped ) {
235+ return ;
236+ }
237+ }
238+ }
228239
229240 /**
230241 * Reads an entire message and writes it to output in wire format. This will read either until EOF
231242 * or until an endgroup tag, whichever comes first.
232243 */
233- public abstract void skipMessage (CodedOutputStream output ) throws IOException ;
244+ public void skipMessage (CodedOutputStream output ) throws IOException {
245+ while (true ) {
246+ final int tag = readTag ();
247+ if (tag == 0 ) {
248+ return ;
249+ }
250+ boolean fieldSkipped = skipField (tag , output );
251+ if (!fieldSkipped ) {
252+ return ;
253+ }
254+ }
255+ }
234256
235257 // -----------------------------------------------------------------
236258
@@ -700,26 +722,6 @@ public boolean skipField(final int tag, final CodedOutputStream output) throws I
700722 }
701723 }
702724
703- @ Override
704- public void skipMessage () throws IOException {
705- while (true ) {
706- final int tag = readTag ();
707- if (tag == 0 || !skipField (tag )) {
708- return ;
709- }
710- }
711- }
712-
713- @ Override
714- public void skipMessage (CodedOutputStream output ) throws IOException {
715- while (true ) {
716- final int tag = readTag ();
717- if (tag == 0 || !skipField (tag , output )) {
718- return ;
719- }
720- }
721- }
722-
723725 // -----------------------------------------------------------------
724726
725727 @ Override
@@ -1412,26 +1414,6 @@ public boolean skipField(final int tag, final CodedOutputStream output) throws I
14121414 }
14131415 }
14141416
1415- @ Override
1416- public void skipMessage () throws IOException {
1417- while (true ) {
1418- final int tag = readTag ();
1419- if (tag == 0 || !skipField (tag )) {
1420- return ;
1421- }
1422- }
1423- }
1424-
1425- @ Override
1426- public void skipMessage (CodedOutputStream output ) throws IOException {
1427- while (true ) {
1428- final int tag = readTag ();
1429- if (tag == 0 || !skipField (tag , output )) {
1430- return ;
1431- }
1432- }
1433- }
1434-
14351417 // -----------------------------------------------------------------
14361418
14371419 @ Override
@@ -2178,26 +2160,6 @@ public boolean skipField(final int tag, final CodedOutputStream output) throws I
21782160 }
21792161 }
21802162
2181- @ Override
2182- public void skipMessage () throws IOException {
2183- while (true ) {
2184- final int tag = readTag ();
2185- if (tag == 0 || !skipField (tag )) {
2186- return ;
2187- }
2188- }
2189- }
2190-
2191- @ Override
2192- public void skipMessage (CodedOutputStream output ) throws IOException {
2193- while (true ) {
2194- final int tag = readTag ();
2195- if (tag == 0 || !skipField (tag , output )) {
2196- return ;
2197- }
2198- }
2199- }
2200-
22012163 /** Collects the bytes skipped and returns the data in a ByteBuffer. */
22022164 private class SkippedDataSink implements RefillCallback {
22032165 private int lastPos = pos ;
@@ -3325,26 +3287,6 @@ public boolean skipField(final int tag, final CodedOutputStream output) throws I
33253287 }
33263288 }
33273289
3328- @ Override
3329- public void skipMessage () throws IOException {
3330- while (true ) {
3331- final int tag = readTag ();
3332- if (tag == 0 || !skipField (tag )) {
3333- return ;
3334- }
3335- }
3336- }
3337-
3338- @ Override
3339- public void skipMessage (CodedOutputStream output ) throws IOException {
3340- while (true ) {
3341- final int tag = readTag ();
3342- if (tag == 0 || !skipField (tag , output )) {
3343- return ;
3344- }
3345- }
3346- }
3347-
33483290 // -----------------------------------------------------------------
33493291
33503292 @ Override
0 commit comments