code: public static int computeRawMessageSetExtensionSize(
        final int fieldNumber, final ByteString value) {
      return computeTagSize(WireFormat.MESSAGE_SET_ITEM) * 2 +
             computeUInt32Size(WireFormat.MESSAGE_SET_TYPE_ID, fieldNumber) +
             computeBytesSize(WireFormat.MESSAGE_SET_MESSAGE, value);
    }
docs: 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.