/**
* Reads and discards a single field, given its tag value.
*
* @return {@code false} if the tag is an endgroup tag, in which case nothing is skipped. Otherwise, returns
* {@code true}.
*/
public boolean skipField(final int tag) throws IOException {
switch (getTagWireType(tag)) {
case WireFormat.WIRETYPE_VARINT:
readInt32();
return true;
case WireFormat.WIRETYPE_FIXED64:
readRawLittleEndian64();
return true;
case WireFormat.WIRETYPE_LENGTH_DELIMITED:
skipRawBytes(readRawVarint32());
return true;
case WireFormat.WIRETYPE_START_GROUP:
skipMessage();
checkLastTagWas(makeTag(WireFormat.getTagFieldNumber(tag), WireFormat.WIRETYPE_END_GROUP));
return true;
case WireFormat.WIRETYPE_END_GROUP:
return false;
case WireFormat.WIRETYPE_FIXED32:
readRawLittleEndian32();
return true;
default:
throw new InvalidProtocolBufferException("Protocol message tag had invalid wire type.");
}
}
ByteBufCodedInputStream.java 文件源码
java
阅读 29
收藏 0
点赞 0
评论 0
项目:incubator-pulsar
作者:
评论列表
文章目录