@@ -223,13 +223,35 @@ public abstract boolean skipField(final int tag, final CodedOutputStream output)
223
223
* Reads and discards an entire message. This will read either until EOF or until an endgroup tag,
224
224
* whichever comes first.
225
225
*/
226
- public abstract void skipMessage () throws IOException ;
226
+ public void skipMessage () throws IOException {
227
+ while (true ) {
228
+ final int tag = readTag ();
229
+ if (tag == 0 ) {
230
+ return ;
231
+ }
232
+ boolean fieldSkipped = skipField (tag );
233
+ if (!fieldSkipped ) {
234
+ return ;
235
+ }
236
+ }
237
+ }
227
238
228
239
/**
229
240
* Reads an entire message and writes it to output in wire format. This will read either until EOF
230
241
* or until an endgroup tag, whichever comes first.
231
242
*/
232
- public abstract void skipMessage (CodedOutputStream output ) throws IOException ;
243
+ public void skipMessage (CodedOutputStream output ) throws IOException {
244
+ while (true ) {
245
+ final int tag = readTag ();
246
+ if (tag == 0 ) {
247
+ return ;
248
+ }
249
+ boolean fieldSkipped = skipField (tag , output );
250
+ if (!fieldSkipped ) {
251
+ return ;
252
+ }
253
+ }
254
+ }
233
255
234
256
// -----------------------------------------------------------------
235
257
@@ -699,26 +721,6 @@ public boolean skipField(final int tag, final CodedOutputStream output) throws I
699
721
}
700
722
}
701
723
702
- @ Override
703
- public void skipMessage () throws IOException {
704
- while (true ) {
705
- final int tag = readTag ();
706
- if (tag == 0 || !skipField (tag )) {
707
- return ;
708
- }
709
- }
710
- }
711
-
712
- @ Override
713
- public void skipMessage (CodedOutputStream output ) throws IOException {
714
- while (true ) {
715
- final int tag = readTag ();
716
- if (tag == 0 || !skipField (tag , output )) {
717
- return ;
718
- }
719
- }
720
- }
721
-
722
724
// -----------------------------------------------------------------
723
725
724
726
@ Override
@@ -1411,26 +1413,6 @@ public boolean skipField(final int tag, final CodedOutputStream output) throws I
1411
1413
}
1412
1414
}
1413
1415
1414
- @ Override
1415
- public void skipMessage () throws IOException {
1416
- while (true ) {
1417
- final int tag = readTag ();
1418
- if (tag == 0 || !skipField (tag )) {
1419
- return ;
1420
- }
1421
- }
1422
- }
1423
-
1424
- @ Override
1425
- public void skipMessage (CodedOutputStream output ) throws IOException {
1426
- while (true ) {
1427
- final int tag = readTag ();
1428
- if (tag == 0 || !skipField (tag , output )) {
1429
- return ;
1430
- }
1431
- }
1432
- }
1433
-
1434
1416
// -----------------------------------------------------------------
1435
1417
1436
1418
@ Override
@@ -2176,26 +2158,6 @@ public boolean skipField(final int tag, final CodedOutputStream output) throws I
2176
2158
}
2177
2159
}
2178
2160
2179
- @ Override
2180
- public void skipMessage () throws IOException {
2181
- while (true ) {
2182
- final int tag = readTag ();
2183
- if (tag == 0 || !skipField (tag )) {
2184
- return ;
2185
- }
2186
- }
2187
- }
2188
-
2189
- @ Override
2190
- public void skipMessage (CodedOutputStream output ) throws IOException {
2191
- while (true ) {
2192
- final int tag = readTag ();
2193
- if (tag == 0 || !skipField (tag , output )) {
2194
- return ;
2195
- }
2196
- }
2197
- }
2198
-
2199
2161
/** Collects the bytes skipped and returns the data in a ByteBuffer. */
2200
2162
private class SkippedDataSink implements RefillCallback {
2201
2163
private int lastPos = pos ;
@@ -3307,26 +3269,6 @@ public boolean skipField(final int tag, final CodedOutputStream output) throws I
3307
3269
}
3308
3270
}
3309
3271
3310
- @ Override
3311
- public void skipMessage () throws IOException {
3312
- while (true ) {
3313
- final int tag = readTag ();
3314
- if (tag == 0 || !skipField (tag )) {
3315
- return ;
3316
- }
3317
- }
3318
- }
3319
-
3320
- @ Override
3321
- public void skipMessage (CodedOutputStream output ) throws IOException {
3322
- while (true ) {
3323
- final int tag = readTag ();
3324
- if (tag == 0 || !skipField (tag , output )) {
3325
- return ;
3326
- }
3327
- }
3328
- }
3329
-
3330
3272
// -----------------------------------------------------------------
3331
3273
3332
3274
@ Override
0 commit comments