/// <summary> /// Skips the data for the field with the tag we've just read. /// This should be called directly after <see cref="ReadTag"/>, when /// the caller wishes to skip an unknown field. /// </summary> /// <remarks> /// This method throws <see cref="InvalidProtocolBufferException"/> if the last-read tag was an end-group tag. /// If a caller wishes to skip a group, they should skip the whole group, by calling this method after reading the /// start-group tag. This behavior allows callers to call this method on any field they don't understand, correctly /// resulting in an error if an end-group tag has not been paired with an earlier start-group tag. /// </remarks> /// <exception cref="InvalidProtocolBufferException">The last tag was an end-group tag</exception> /// <exception cref="InvalidOperationException">The last read operation read to the end of the logical stream</exception> public void SkipLastField() { var span = new ReadOnlySpan <byte>(buffer); ParsingPrimitivesMessages.SkipLastField(ref span, ref state); }
/// <summary> /// Skip a group. /// </summary> internal void SkipGroup(uint startGroupTag) { var span = new ReadOnlySpan <byte>(buffer); ParsingPrimitivesMessages.SkipGroup(ref span, ref state, startGroupTag); }
/// <summary> /// Verifies that the last call to ReadTag() returned tag 0 - in other words, /// we've reached the end of the stream when we expected to. /// </summary> /// <exception cref="InvalidProtocolBufferException">The /// tag read was not the one specified</exception> internal void CheckReadEndOfStreamTag() { ParsingPrimitivesMessages.CheckReadEndOfStreamTag(ref state); }