mergeFieldFromBuffer method Null safety

bool mergeFieldFromBuffer(
  1. int tag,
  2. CodedBufferReader input
)

Implementation

bool mergeFieldFromBuffer(int tag, CodedBufferReader input) {
  _ensureWritable('mergeFieldFromBuffer');
  var number = getTagFieldNumber(tag);
  switch (getTagWireType(tag)) {
    case WIRETYPE_VARINT:
      mergeVarintField(number, input.readInt64());
      return true;
    case WIRETYPE_FIXED64:
      mergeFixed64Field(number, input.readFixed64());
      return true;
    case WIRETYPE_LENGTH_DELIMITED:
      mergeLengthDelimitedField(number, input.readBytes());
      return true;
    case WIRETYPE_START_GROUP:
      var subGroup = input.readUnknownFieldSetGroup(number);
      mergeGroupField(number, subGroup);
      return true;
    case WIRETYPE_END_GROUP:
      return false;
    case WIRETYPE_FIXED32:
      mergeFixed32Field(number, input.readFixed32());
      return true;
    default:
      throw InvalidProtocolBufferException.invalidWireType();
  }
}