/** * Compute the number of bytes that would be needed to encode an * {@code int32} field, including tag. */ public static int computeInt32SizeNoTag(final int value) { if (value >= 0) { return computeUInt32SizeNoTag(value); } else { // Must sign-extend. return MAX_VARINT_SIZE; } }
static int computeLengthDelimitedFieldSize(int fieldLength) { return computeUInt32SizeNoTag(fieldLength) + fieldLength; }
/** * Compute the number of bytes that would be needed to encode a varint. * {@code value} is treated as unsigned, so it won't be sign-extended if * negative. * * @deprecated use {@link #computeUInt32SizeNoTag(int)} instead. */ @Deprecated public static int computeRawVarint32Size(final int value) { return computeUInt32SizeNoTag(value); }
/** * Compute the number of bytes that would be needed to encode an * {@code sint32} field. */ public static int computeSInt32SizeNoTag(final int value) { return computeUInt32SizeNoTag(encodeZigZag32(value)); }
/** * Compute the number of bytes that would be needed to encode a * {@code uint32} field, including tag. */ public static int computeUInt32Size(final int fieldNumber, final int value) { return computeTagSize(fieldNumber) + computeUInt32SizeNoTag(value); }
/** * Compute the number of bytes that would be needed to encode a * {@code uint32} field, including tag. */ public static int computeUInt32Size(final int fieldNumber, final int value) { return computeTagSize(fieldNumber) + computeUInt32SizeNoTag(value); }
/** Compute the number of bytes that would be needed to encode a tag. */ public static int computeTagSize(final int fieldNumber) { return computeUInt32SizeNoTag(WireFormat.makeTag(fieldNumber, 0)); }
public int getSerializedSize() { int size = memoizedSerializedSize; if (size != -1) return size; size = 0; if (((bitField0_ & 0x00000001) == 0x00000001)) { size += com.google.protobuf.CodedOutputStream .computeBytesSize(1, user_); } { int dataSize = 0; for (int i = 0; i < auth_.size(); i++) { dataSize += com.google.protobuf.CodedOutputStream .computeUInt32SizeNoTag(auth_.get(i)); } size += dataSize; size += 1 * getAuthList().size(); } size += getUnknownFields().getSerializedSize(); memoizedSerializedSize = size; return size; }
public int getSerializedSize() { int size = memoizedSerializedSize; if (size != -1) return size; size = 0; if (((bitField0_ & 0x00000001) == 0x00000001)) { size += com.google.protobuf.CodedOutputStream .computeUInt64Size(1, version_); } { int dataSize = 0; for (int i = 0; i < methods_.size(); i++) { dataSize += com.google.protobuf.CodedOutputStream .computeUInt32SizeNoTag(methods_.get(i)); } size += dataSize; size += 1 * getMethodsList().size(); } size += getUnknownFields().getSerializedSize(); memoizedSerializedSize = size; return size; }
@java.lang.Override public int getSerializedSize() { int size = memoizedSize; if (size != -1) return size; size = 0; if (!getNameBytes().isEmpty()) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); } if (!getDisplayNameBytes().isEmpty()) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, displayName_); } { int dataSize = 0; for (int i = 0; i < supportedBy_.size(); i++) { dataSize += com.google.protobuf.CodedOutputStream.computeEnumSizeNoTag(supportedBy_.get(i)); } size += dataSize; if (!getSupportedByList().isEmpty()) { size += 1; size += com.google.protobuf.CodedOutputStream.computeUInt32SizeNoTag(dataSize); } supportedByMemoizedSerializedSize = dataSize; } size += unknownFields.getSerializedSize(); memoizedSize = size; return size; }
@Override public int getSerializedSize() { int size = memoizedSerializedSize; if (size != -1) return size; size = 0; if (((bitField0_ & 0x00000001) == 0x00000001)) { size += com.google.protobuf.CodedOutputStream .computeUInt32Size(1, sliceDim_); } { int dataSize = 0; for (int i = 0; i < slicePoint_.size(); i++) { dataSize += com.google.protobuf.CodedOutputStream .computeUInt32SizeNoTag(slicePoint_.get(i)); } size += dataSize; size += 1 * getSlicePointList().size(); } size += getUnknownFields().getSerializedSize(); memoizedSerializedSize = size; return size; }
if (!getMessageTypesList().isEmpty()) { size += 1; size += com.google.protobuf.CodedOutputStream.computeUInt32SizeNoTag(dataSize);
if (!getStatesList().isEmpty()) { size += 1; size += com.google.protobuf.CodedOutputStream.computeUInt32SizeNoTag(dataSize);
if (!getFeaturesList().isEmpty()) { size += 1; size += com.google.protobuf.CodedOutputStream.computeUInt32SizeNoTag(dataSize);
if (!getFeaturesList().isEmpty()) { size += 1; size += com.google.protobuf.CodedOutputStream.computeUInt32SizeNoTag(dataSize);
if (!getFeaturesList().isEmpty()) { size += 1; size += com.google.protobuf.CodedOutputStream.computeUInt32SizeNoTag(dataSize);
if (!getFeaturesList().isEmpty()) { size += 1; size += com.google.protobuf.CodedOutputStream.computeUInt32SizeNoTag(dataSize);
if (!getFeaturesList().isEmpty()) { size += 1; size += com.google.protobuf.CodedOutputStream.computeUInt32SizeNoTag(dataSize);
for (int i = 0; i < tags_.size(); i++) { dataSize += com.google.protobuf.CodedOutputStream .computeUInt32SizeNoTag(tags_.get(i)); for (int i = 0; i < geometry_.size(); i++) { dataSize += com.google.protobuf.CodedOutputStream .computeUInt32SizeNoTag(geometry_.get(i));
case GROUP : return CodedOutputStream.computeGroupSizeNoTag ((MessageLite)value); case BYTES : return CodedOutputStream.computeBytesSizeNoTag ((ByteString )value); case UINT32 : return CodedOutputStream.computeUInt32SizeNoTag ((Integer )value); case SFIXED32: return CodedOutputStream.computeSFixed32SizeNoTag((Integer )value); case SFIXED64: return CodedOutputStream.computeSFixed64SizeNoTag((Long )value);