yijunyu/c-to-rust huggingface dataset:
// Original:
public double resolveDistErr(SpatialContext ctx, double defaultDistErrPct) {if (distErr != null)return distErr;double distErrPct = (this.distErrPct != null ? this.distErrPct : defaultDistErrPct);return calcDistanceFromErrPct(shape, distErrPct, ctx);}

// Translation:
public virtual double ResolveDistErr(SpatialContext ctx, double defaultDistErrPct){if (DistErr != null)return DistErr.Value;double distErrPct = (this.distErrPct ?? defaultDistErrPct);return CalcDistanceFromErrPct(Shape, distErrPct, ctx);}
// Original:
public final CharsetEncoder replaceWith(byte[] replacement) {if (replacement == null) {throw new IllegalArgumentException("replacement == null");}if (replacement.length == 0) {throw new IllegalArgumentException("replacement.length == 0");}if (replacement.length > maxBytesPerChar()) {throw new IllegalArgumentException("replacement length > maxBytesPerChar: " +replacement.length + " > " + maxBytesPerChar());}if (!isLegalReplacement(replacement)) {throw new IllegalArgumentException("bad replacement: " + Arrays.toString(replacement));}this.replacementBytes = replacement;implReplaceWith(replacementBytes);return this;}

// Translation:
public java.nio.charset.CharsetEncoder replaceWith(byte[] replacement_1){if (replacement_1 == null){throw new System.ArgumentException("replacement == null");}if (replacement_1.Length == 0){throw new System.ArgumentException("replacement.length == 0");}if (replacement_1.Length > maxBytesPerChar()){throw new System.ArgumentException("replacement length > maxBytesPerChar: " + replacement_1.Length + " > " + maxBytesPerChar());}if (!isLegalReplacement(replacement_1)){throw new System.ArgumentException("bad replacement: " + java.util.Arrays.toString(replacement_1));}this.replacementBytes = replacement_1;implReplaceWith(replacementBytes);return this;}
// Original:
public CreateApplicationSnapshotResult createApplicationSnapshot(CreateApplicationSnapshotRequest request) {request = beforeClientExecution(request);return executeCreateApplicationSnapshot(request);}

// Translation:
public virtual CreateApplicationSnapshotResponse CreateApplicationSnapshot(CreateApplicationSnapshotRequest request){var options = new InvokeOptions();options.RequestMarshaller = CreateApplicationSnapshotRequestMarshaller.Instance;options.ResponseUnmarshaller = CreateApplicationSnapshotResponseUnmarshaller.Instance;return Invoke<CreateApplicationSnapshotResponse>(request, options);}
// Original:
public ValueEval evaluate(int srcCellRow, int srcCellCol, ValueEval arg0) {double d;try {ValueEval ve = OperandResolver.getSingleValue(arg0, srcCellRow, srcCellCol);if(ve instanceof StringEval) {return ve;}d = OperandResolver.coerceValueToDouble(ve);} catch (EvaluationException e) {return e.getErrorEval();}return new NumberEval(+d);}

// Translation:
public override ValueEval Evaluate(int srcCellRow, int srcCellCol, ValueEval arg0){double d;try{ValueEval ve = OperandResolver.GetSingleValue(arg0, srcCellRow, srcCellCol);if (ve is BlankEval){return NumberEval.ZERO;}if (ve is StringEval){return ve;}d = OperandResolver.CoerceValueToDouble(ve);}catch (EvaluationException e){return e.GetErrorEval();}return new NumberEval(+d);}
// Original:
public MoPenBindIsvRequest() {super("MoPen", "2018-02-11", "MoPenBindIsv", "mopen");setProtocol(ProtocolType.HTTPS);setMethod(MethodType.POST);}

// Translation:
public MoPenBindIsvRequest(): base("MoPen", "2018-02-11", "MoPenBindIsv", "mopen", "openAPI"){Protocol = ProtocolType.HTTPS;Method = MethodType.POST;}
// Original:
public AssociateIpGroupsResult associateIpGroups(AssociateIpGroupsRequest request) {request = beforeClientExecution(request);return executeAssociateIpGroups(request);}

// Translation:
public virtual AssociateIpGroupsResponse AssociateIpGroups(AssociateIpGroupsRequest request){var options = new InvokeOptions();options.RequestMarshaller = AssociateIpGroupsRequestMarshaller.Instance;options.ResponseUnmarshaller = AssociateIpGroupsResponseUnmarshaller.Instance;return Invoke<AssociateIpGroupsResponse>(request, options);}
// Original:
public TestEventPatternResult testEventPattern(TestEventPatternRequest request) {request = beforeClientExecution(request);return executeTestEventPattern(request);}

// Translation:
public virtual TestEventPatternResponse TestEventPattern(TestEventPatternRequest request){var options = new InvokeOptions();options.RequestMarshaller = TestEventPatternRequestMarshaller.Instance;options.ResponseUnmarshaller = TestEventPatternResponseUnmarshaller.Instance;return Invoke<TestEventPatternResponse>(request, options);}
// Original:
public LockFailedException(File file, String message) {super(message);this.file = file;}

// Translation:
public LockFailedException(FilePath file, string message) : base(message){this.file = file;}
// Original:
public DeleteSkillGroupResult deleteSkillGroup(DeleteSkillGroupRequest request) {request = beforeClientExecution(request);return executeDeleteSkillGroup(request);}

// Translation:
public virtual DeleteSkillGroupResponse DeleteSkillGroup(DeleteSkillGroupRequest request){var options = new InvokeOptions();options.RequestMarshaller = DeleteSkillGroupRequestMarshaller.Instance;options.ResponseUnmarshaller = DeleteSkillGroupResponseUnmarshaller.Instance;return Invoke<DeleteSkillGroupResponse>(request, options);}
// Original:
public SortedDocValuesField(String name, BytesRef bytes) {super(name, TYPE);fieldsData = bytes;}

// Translation:
public SortedDocValuesField(string name, BytesRef bytes): base(name, TYPE){FieldsData = bytes;}
// Original:
public CreateNetworkResult createNetwork(CreateNetworkRequest request) {request = beforeClientExecution(request);return executeCreateNetwork(request);}

// Translation:
public virtual CreateNetworkResponse CreateNetwork(CreateNetworkRequest request){var options = new InvokeOptions();options.RequestMarshaller = CreateNetworkRequestMarshaller.Instance;options.ResponseUnmarshaller = CreateNetworkResponseUnmarshaller.Instance;return Invoke<CreateNetworkResponse>(request, options);}
// Original:
public DeleteGroupRequest(String groupName) {setGroupName(groupName);}

// Translation:
public DeleteGroupRequest(string groupName){_groupName = groupName;}
// Original:
public DescribeCacheEngineVersionsResult describeCacheEngineVersions(DescribeCacheEngineVersionsRequest request) {request = beforeClientExecution(request);return executeDescribeCacheEngineVersions(request);}

// Translation:
public virtual DescribeCacheEngineVersionsResponse DescribeCacheEngineVersions(DescribeCacheEngineVersionsRequest request){var options = new InvokeOptions();options.RequestMarshaller = DescribeCacheEngineVersionsRequestMarshaller.Instance;options.ResponseUnmarshaller = DescribeCacheEngineVersionsResponseUnmarshaller.Instance;return Invoke<DescribeCacheEngineVersionsResponse>(request, options);}
// Original:
public int compareSameType(Object other) {assert exists || (false == value);MutableValueBool b = (MutableValueBool)other;if (value != b.value) return value ? 1 : -1;if (exists == b.exists) return 0;return exists ? 1 : -1;}

// Translation:
public override int CompareSameType(object other){MutableValueBool b = (MutableValueBool)other;if (Value != b.Value){return Value ? 1 : 0;}if (Exists == b.Exists){return 0;}return Exists ? 1 : -1;}
// Original:
public LineParser(String[] header) {this.header = header;}

// Translation:
public LineParser(string[] header){this.m_header = header;}
// Original:
public DBInstance restoreDBInstanceFromDBSnapshot(RestoreDBInstanceFromDBSnapshotRequest request) {request = beforeClientExecution(request);return executeRestoreDBInstanceFromDBSnapshot(request);}

// Translation:
public virtual RestoreDBInstanceFromDBSnapshotResponse RestoreDBInstanceFromDBSnapshot(RestoreDBInstanceFromDBSnapshotRequest request){var options = new InvokeOptions();options.RequestMarshaller = RestoreDBInstanceFromDBSnapshotRequestMarshaller.Instance;options.ResponseUnmarshaller = RestoreDBInstanceFromDBSnapshotResponseUnmarshaller.Instance;return Invoke<RestoreDBInstanceFromDBSnapshotResponse>(request, options);}
// Original:
public void push(E e) {addFirstImpl(e);}

// Translation:
public virtual void push(E e){addFirstImpl(e);}
// Original:
public synchronized void reset() throws IOException {if (buf == null) {throw new IOException("Stream is closed");}if (-1 == markpos) {throw new IOException("Mark has been invalidated.");}pos = markpos;}

// Translation:
public override void reset(){lock (this){if (buf == null){throw new System.IO.IOException("Stream is closed");}if (-1 == markpos){throw new System.IO.IOException("Mark has been invalidated.");}pos = markpos;}}
// Original:
public UpdateUsagePlanResult updateUsagePlan(UpdateUsagePlanRequest request) {request = beforeClientExecution(request);return executeUpdateUsagePlan(request);}

// Translation:
public virtual UpdateUsagePlanResponse UpdateUsagePlan(UpdateUsagePlanRequest request){var options = new InvokeOptions();options.RequestMarshaller = UpdateUsagePlanRequestMarshaller.Instance;options.ResponseUnmarshaller = UpdateUsagePlanResponseUnmarshaller.Instance;return Invoke<UpdateUsagePlanResponse>(request, options);}
// Original:
public boolean equals(Object obj) {if (this == obj) {return true;}if (obj == null) {return false;}if (getClass() != obj.getClass()) {return false;}TermInfo other = (TermInfo) obj;return position == other.position;}

// Translation:
public override bool Equals(object obj){if (this == obj){return true;}if (obj == null){return false;}if (GetType() != obj.GetType()){return false;}TermInfo other = (TermInfo)obj;if (position != other.position){return false;}return true;}
// Original:
public StringPtg(String value) {if (value.length() > 255) {throw new IllegalArgumentException("String literals in formulas can't be bigger than 255 characters ASCII");}_is16bitUnicode = StringUtil.hasMultibyte(value);field_3_string = value;}

// Translation:
public StringPtg(String value){if (value.Length > 255){throw new ArgumentException("String literals in formulas can't be bigger than 255 Chars ASCII");}_is16bitUnicode = StringUtil.HasMultibyte(value);field_3_string = value;field_1_Length = value.Length; }
// Original:
public ChangeType getChangeType() {return changeType;}

// Translation:
public virtual DiffEntry.ChangeType GetChangeType(){return changeType;}
// Original:
public String asFormulaString() {StringBuilder sb = new StringBuilder(32);asFormulaString(sb);return sb.toString();}

// Translation:
public String AsFormulaString(){StringBuilder sb = new StringBuilder(32);AsFormulaString(sb);return sb.ToString();}
// Original:
public void serialize(LittleEndianOutput out) {out.writeShort(sid);out.writeShort(getDataSize());out.writeShort(field_1_objectType);out.writeShort(field_2_objectId);out.writeShort(field_3_option);out.writeInt(field_4_reserved1);out.writeInt(field_5_reserved2);out.writeInt(field_6_reserved3);}

// Translation:
public override void Serialize(ILittleEndianOutput out1){out1.WriteShort(sid);out1.WriteShort(DataSize);out1.WriteShort(field_1_objectType);out1.WriteShort(field_2_objectId);out1.WriteShort(field_3_option);out1.WriteInt(field_4_reserved1);out1.WriteInt(field_5_reserved2);out1.WriteInt(field_6_reserved3);}
// Original:
public DescribeAppResult describeApp(DescribeAppRequest request) {request = beforeClientExecution(request);return executeDescribeApp(request);}

// Translation:
public virtual DescribeAppResponse DescribeApp(DescribeAppRequest request){var options = new InvokeOptions();options.RequestMarshaller = DescribeAppRequestMarshaller.Instance;options.ResponseUnmarshaller = DescribeAppResponseUnmarshaller.Instance;return Invoke<DescribeAppResponse>(request, options);}
// Original:
public Map<String, DirCacheEntry> getToBeCheckedOut() {return toBeCheckedOut;}

// Translation:
public virtual IDictionary<string, DirCacheEntry> GetToBeCheckedOut(){return toBeCheckedOut;}
// Original:
public CreatePublicVirtualInterfaceResult createPublicVirtualInterface(CreatePublicVirtualInterfaceRequest request) {request = beforeClientExecution(request);return executeCreatePublicVirtualInterface(request);}

// Translation:
public virtual CreatePublicVirtualInterfaceResponse CreatePublicVirtualInterface(CreatePublicVirtualInterfaceRequest request){var options = new InvokeOptions();options.RequestMarshaller = CreatePublicVirtualInterfaceRequestMarshaller.Instance;options.ResponseUnmarshaller = CreatePublicVirtualInterfaceResponseUnmarshaller.Instance;return Invoke<CreatePublicVirtualInterfaceResponse>(request, options);}
// Original:
public CreateQueueResult createQueue(String queueName) {return createQueue(new CreateQueueRequest().withQueueName(queueName));}

// Translation:
public virtual CreateQueueResponse CreateQueue(string queueName){var request = new CreateQueueRequest();request.QueueName = queueName;return CreateQueue(request);}
// Original:
public ParseException generateParseException() {jj_expentries.clear();boolean[] la1tokens = new boolean[33];if (jj_kind >= 0) {la1tokens[jj_kind] = true;jj_kind = -1;}for (int i = 0; i < 25; i++) {if (jj_la1[i] == jj_gen) {for (int j = 0; j < 32; j++) {if ((jj_la1_0[i] & (1<<j)) != 0) {la1tokens[j] = true;}if ((jj_la1_1[i] & (1<<j)) != 0) {la1tokens[32+j] = true;}}}}for (int i = 0; i < 33; i++) {if (la1tokens[i]) {jj_expentry = new int[1];jj_expentry[0] = i;jj_expentries.add(jj_expentry);}}jj_endpos = 0;jj_rescan_token();jj_add_error_token(0, 0);int[][] exptokseq = new int[jj_expentries.size()][];for (int i = 0; i < jj_expentries.size(); i++) {exptokseq[i] = jj_expentries.get(i);}return new ParseException(token, exptokseq, tokenImage);}

// Translation:
public virtual ParseException GenerateParseException(){jj_expentries.Clear();bool[] la1tokens = new bool[24];if (jj_kind >= 0){la1tokens[jj_kind] = true;jj_kind = -1;}for (int i = 0; i < 10; i++){if (jj_la1[i] == jj_gen){for (int j = 0; j < 32; j++){if ((jj_la1_0[i] & (1 << j)) != 0){la1tokens[j] = true;}}}}for (int i = 0; i < 24; i++){if (la1tokens[i]){jj_expentry = new int[1];jj_expentry[0] = i;jj_expentries.Add(jj_expentry);}}jj_endpos = 0;Jj_rescan_token();Jj_add_error_token(0, 0);int[][] exptokseq = new int[jj_expentries.Count][];for (int i = 0; i < jj_expentries.Count; i++){exptokseq[i] = jj_expentries[i];}return new ParseException(Token, exptokseq, QueryParserConstants.TokenImage);}
// Original:
public CreateFieldLevelEncryptionProfileResult createFieldLevelEncryptionProfile(CreateFieldLevelEncryptionProfileRequest request) {request = beforeClientExecution(request);return executeCreateFieldLevelEncryptionProfile(request);}

// Translation:
public virtual CreateFieldLevelEncryptionProfileResponse CreateFieldLevelEncryptionProfile(CreateFieldLevelEncryptionProfileRequest request){var options = new InvokeOptions();options.RequestMarshaller = CreateFieldLevelEncryptionProfileRequestMarshaller.Instance;options.ResponseUnmarshaller = CreateFieldLevelEncryptionProfileResponseUnmarshaller.Instance;return Invoke<CreateFieldLevelEncryptionProfileResponse>(request, options);}
// Original:
public static int getSmileyResource(int which) {return sIconIds[which];}

// Translation:
public static int getSmileyResource(int which){return sIconIds[which];}
// Original:
public String toString(){StringBuilder buffer = new StringBuilder();buffer.append("[SCL]\n");buffer.append("    .numerator            = ").append("0x").append(HexDump.toHex(  getNumerator ())).append(" (").append( getNumerator() ).append(" )");buffer.append(System.getProperty("line.separator"));buffer.append("    .denominator          = ").append("0x").append(HexDump.toHex(  getDenominator ())).append(" (").append( getDenominator() ).append(" )");buffer.append(System.getProperty("line.separator"));buffer.append("[/SCL]\n");return buffer.toString();}

// Translation:
public override String ToString(){StringBuilder buffer = new StringBuilder();buffer.Append("[SCL]\n");buffer.Append("    .numerator            = ").Append("0x").Append(HexDump.ToHex(Numerator)).Append(" (").Append(Numerator).Append(" )");buffer.Append(Environment.NewLine);buffer.Append("    .denominator          = ").Append("0x").Append(HexDump.ToHex(Denominator)).Append(" (").Append(Denominator).Append(" )");buffer.Append(Environment.NewLine);buffer.Append("[/SCL]\n");return buffer.ToString();}
// Original:
public final void setBufferSize(int newSize) {assert buffer == null || bufferSize == buffer.length: "buffer=" + buffer + " bufferSize=" + bufferSize + " buffer.length=" + (buffer != null ? buffer.length : 0);if (newSize != bufferSize) {checkBufferSize(newSize);bufferSize = newSize;if (buffer != null) {byte[] newBuffer = new byte[newSize];final int leftInBuffer = bufferLength-bufferPosition;final int numToCopy;if (leftInBuffer > newSize)numToCopy = newSize;elsenumToCopy = leftInBuffer;System.arraycopy(buffer, bufferPosition, newBuffer, 0, numToCopy);bufferStart += bufferPosition;bufferPosition = 0;bufferLength = numToCopy;newBuffer(newBuffer);}}}

// Translation:
public void SetBufferSize(int newSize){Debug.Assert(m_buffer == null || bufferSize == m_buffer.Length, "buffer=" + m_buffer + " bufferSize=" + bufferSize + " buffer.length=" + (m_buffer != null ? m_buffer.Length : 0));if (newSize != bufferSize){CheckBufferSize(newSize);bufferSize = newSize;if (m_buffer != null){byte[] newBuffer = new byte[newSize];int leftInBuffer = bufferLength - bufferPosition;int numToCopy;if (leftInBuffer > newSize){numToCopy = newSize;}else{numToCopy = leftInBuffer;}Array.Copy(m_buffer, bufferPosition, newBuffer, 0, numToCopy);bufferStart += bufferPosition;bufferPosition = 0;bufferLength = numToCopy;NewBuffer(newBuffer);}}}
// Original:
public DisassociateSigninDelegateGroupsFromAccountResult disassociateSigninDelegateGroupsFromAccount(DisassociateSigninDelegateGroupsFromAccountRequest request) {request = beforeClientExecution(request);return executeDisassociateSigninDelegateGroupsFromAccount(request);}

// Translation:
public virtual DisassociateSigninDelegateGroupsFromAccountResponse DisassociateSigninDelegateGroupsFromAccount(DisassociateSigninDelegateGroupsFromAccountRequest request){var options = new InvokeOptions();options.RequestMarshaller = DisassociateSigninDelegateGroupsFromAccountRequestMarshaller.Instance;options.ResponseUnmarshaller = DisassociateSigninDelegateGroupsFromAccountResponseUnmarshaller.Instance;return Invoke<DisassociateSigninDelegateGroupsFromAccountResponse>(request, options);}
// Original:
public TokenStream create(TokenStream input) {return new IndicNormalizationFilter(input);}

// Translation:
public override TokenStream Create(TokenStream input){return new IndicNormalizationFilter(input);}
// Original:
public TickRecord(RecordInputStream in) {field_1_majorTickType = in.readByte();field_2_minorTickType = in.readByte();field_3_labelPosition = in.readByte();field_4_background    = in.readByte();field_5_labelColorRgb = in.readInt();field_6_zero1         = in.readInt();field_7_zero2         = in.readInt();field_8_zero3         = in.readInt();field_9_zero4         = in.readInt();field_10_options      = in.readShort();field_11_tickColor    = in.readShort();field_12_zero5        = in.readShort();}

// Translation:
public TickRecord(RecordInputStream in1){field_1_majorTickType = (byte)in1.ReadByte();field_2_minorTickType = (byte)in1.ReadByte();field_3_labelPosition = (byte)in1.ReadByte();field_4_background = (byte)in1.ReadByte();field_5_labelColorRgb = (byte)in1.ReadInt();field_6_zero1 = in1.ReadInt();field_7_zero2 = in1.ReadInt();field_8_zero3 = in1.ReadInt();field_9_zero4 = in1.ReadInt();field_10_options = in1.ReadShort();field_11_tickColor = in1.ReadShort();field_12_zero5 = in1.ReadShort();}
// Original:
public long getPackedGitLimit() {return packedGitLimit;}

// Translation:
public virtual long GetPackedGitLimit(){return packedGitLimit;}
// Original:
public DisassociateContactFromAddressBookResult disassociateContactFromAddressBook(DisassociateContactFromAddressBookRequest request) {request = beforeClientExecution(request);return executeDisassociateContactFromAddressBook(request);}

// Translation:
public virtual DisassociateContactFromAddressBookResponse DisassociateContactFromAddressBook(DisassociateContactFromAddressBookRequest request){var options = new InvokeOptions();options.RequestMarshaller = DisassociateContactFromAddressBookRequestMarshaller.Instance;options.ResponseUnmarshaller = DisassociateContactFromAddressBookResponseUnmarshaller.Instance;return Invoke<DisassociateContactFromAddressBookResponse>(request, options);}
// Original:
public void writeShort(int v) {checkPosition(2);int i = _writeIndex;_buf[i++] = (byte)((v >>>  0) & 0xFF);_buf[i++] = (byte)((v >>>  8) & 0xFF);_writeIndex = i;}

// Translation:
public void WriteShort(int v){CheckPosition(2);int i = _writeIndex;_buf[i++] = (byte)((v >> 0) & 0xFF);_buf[i++] = (byte)((v >> 8) & 0xFF);_writeIndex = i;}
// Original:
public int read(char[] c, int off, int len) {if (pos < size) {len = Math.min(len, size-pos);s.getChars(pos, pos+len, c, off);pos += len;return len;} else {s = null;return -1;}}

// Translation:
public override int Read(char[] c, int off, int len){if (pos < size){len = Math.Min(len, size - pos);s.CopyTo(pos, c, off, pos + len - pos);pos += len;return len;}else{s = null;return -1;}}
// Original:
public AssociateSkillWithUsersResult associateSkillWithUsers(AssociateSkillWithUsersRequest request) {request = beforeClientExecution(request);return executeAssociateSkillWithUsers(request);}

// Translation:
public virtual AssociateSkillWithUsersResponse AssociateSkillWithUsers(AssociateSkillWithUsersRequest request){var options = new InvokeOptions();options.RequestMarshaller = AssociateSkillWithUsersRequestMarshaller.Instance;options.ResponseUnmarshaller = AssociateSkillWithUsersResponseUnmarshaller.Instance;return Invoke<AssociateSkillWithUsersResponse>(request, options);}
// Original:
public boolean doPrune(double ageSec, IndexSearcher searcher) {return ageSec > maxAgeSec;}

// Translation:
public bool DoPrune(double ageSec, IndexSearcher searcher){return ageSec > maxAgeSec;}
// Original:
public DescribeObservationResult describeObservation(DescribeObservationRequest request) {request = beforeClientExecution(request);return executeDescribeObservation(request);}

// Translation:
public virtual DescribeObservationResponse DescribeObservation(DescribeObservationRequest request){var options = new InvokeOptions();options.RequestMarshaller = DescribeObservationRequestMarshaller.Instance;options.ResponseUnmarshaller = DescribeObservationResponseUnmarshaller.Instance;return Invoke<DescribeObservationResponse>(request, options);}
// Original:
public DeletePresetResult deletePreset(DeletePresetRequest request) {request = beforeClientExecution(request);return executeDeletePreset(request);}

// Translation:
public virtual DeletePresetResponse DeletePreset(DeletePresetRequest request){var options = new InvokeOptions();options.RequestMarshaller = DeletePresetRequestMarshaller.Instance;options.ResponseUnmarshaller = DeletePresetResponseUnmarshaller.Instance;return Invoke<DeletePresetResponse>(request, options);}
// Original:
public long ramBytesUsed() {long size = 0;for (Map.Entry<String,DocValuesProducer> entry : formats.entrySet()) {size += (entry.getKey().length() * Character.BYTES) + entry.getValue().ramBytesUsed();}return size;}

// Translation:
public override long RamBytesUsed(){long size = 0;foreach (KeyValuePair<string, DocValuesProducer> entry in formats){size += (entry.Key.Length * RamUsageEstimator.NUM_BYTES_CHAR)+ entry.Value.RamBytesUsed();}return size;}
// Original:
public UserSViewBegin clone() {return copy();}

// Translation:
public override Object Clone(){return CloneViaReserialise();}
// Original:
public char[] toCharArray() {synchronized (lock) {char[] result = new char[count];System.arraycopy(buf, 0, result, 0, count);return result;}}

// Translation:
public virtual char[] toCharArray(){lock (@lock){char[] result = new char[count];System.Array.Copy(buf, 0, result, 0, count);return result;}}