@@ -223,13 +223,35 @@ public abstract boolean skipField(final int tag, final CodedOutputStream output)
223223 * Reads and discards an entire message. This will read either until EOF or until an endgroup tag,
224224 * whichever comes first.
225225 */
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+ }
227238
228239 /**
229240 * Reads an entire message and writes it to output in wire format. This will read either until EOF
230241 * or until an endgroup tag, whichever comes first.
231242 */
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+ }
233255
234256 // -----------------------------------------------------------------
235257
@@ -699,26 +721,6 @@ public boolean skipField(final int tag, final CodedOutputStream output) throws I
699721 }
700722 }
701723
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-
722724 // -----------------------------------------------------------------
723725
724726 @ Override
@@ -1411,26 +1413,6 @@ public boolean skipField(final int tag, final CodedOutputStream output) throws I
14111413 }
14121414 }
14131415
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-
14341416 // -----------------------------------------------------------------
14351417
14361418 @ Override
@@ -2176,26 +2158,6 @@ public boolean skipField(final int tag, final CodedOutputStream output) throws I
21762158 }
21772159 }
21782160
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-
21992161 /** Collects the bytes skipped and returns the data in a ByteBuffer. */
22002162 private class SkippedDataSink implements RefillCallback {
22012163 private int lastPos = pos ;
@@ -3307,26 +3269,6 @@ public boolean skipField(final int tag, final CodedOutputStream output) throws I
33073269 }
33083270 }
33093271
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-
33303272 // -----------------------------------------------------------------
33313273
33323274 @ Override
0 commit comments