ComputeRawMessageSetExtensionSize() 공개 정적인 메소드

Compute the number of bytes that would be needed to encode an unparsed MessageSet extension field to the stream. For historical reasons, the wire format differs from normal fields.
public static ComputeRawMessageSetExtensionSize ( int fieldNumber, ByteString value ) : int
fieldNumber int
value ByteString
리턴 int
예제 #1
0
        /// <summary>
        /// Get the number of bytes required to encode this field, incuding field number,
        /// using the MessageSet wire format.
        /// </summary>
        public int GetSerializedSizeAsMessageSetExtension(int fieldNumber)
        {
            int result = 0;

            foreach (ByteString value in lengthDelimitedList)
            {
                result += CodedOutputStream.ComputeRawMessageSetExtensionSize(fieldNumber, value);
            }
            return(result);
        }