yijunyu/c-to-rust huggingface dataset:
// Original:
public DVRecord(RecordInputStream in) {_option_flags = in.readInt();_promptTitle = readUnicodeString(in);_errorTitle = readUnicodeString(in);_promptText = readUnicodeString(in);_errorText = readUnicodeString(in);int field_size_first_formula = in.readUShort();_not_used_1 = in.readShort();_formula1 = Formula.read(field_size_first_formula, in);int field_size_sec_formula = in.readUShort();_not_used_2 = in.readShort();_formula2 = Formula.read(field_size_sec_formula, in);_regions = new CellRangeAddressList(in);}

// Translation:
public DVRecord(RecordInputStream in1){_option_flags = in1.ReadInt();_promptTitle = ReadUnicodeString(in1);_errorTitle = ReadUnicodeString(in1);_promptText = ReadUnicodeString(in1);_errorText = ReadUnicodeString(in1);int field_size_first_formula = in1.ReadUShort();_not_used_1 = in1.ReadShort();_formula1 = NPOI.SS.Formula.Formula.Read(field_size_first_formula, in1);int field_size_sec_formula = in1.ReadUShort();_not_used_2 = in1.ReadShort();_formula2 = NPOI.SS.Formula.Formula.Read(field_size_sec_formula, in1);_regions = new CellRangeAddressList(in1);}
// Original:
public String toString() {return pattern();}

// Translation:
public override string ToString(){return Pattern();}
// Original:
public InsertInstanceRequest() {super("Ots", "2016-06-20", "InsertInstance", "ots");setMethod(MethodType.POST);}

// Translation:
public InsertInstanceRequest(): base("Ots", "2016-06-20", "InsertInstance", "ots", "openAPI"){Method = MethodType.POST;}
// Original:
public boolean contains(Object o) {return indexOf(o) != -1;}

// Translation:
public virtual bool contains(object o){return indexOf(o) != -1;}
// Original:
public final ByteBuffer encode(String s) {return encode(CharBuffer.wrap(s));}

// Translation:
public java.nio.ByteBuffer encode(string s){return encode(java.nio.CharBuffer.wrap(java.lang.CharSequenceProxy.Wrap(s)));}
// Original:
public boolean requiresCommitBody() {return false;}

// Translation:
public override bool RequiresCommitBody(){return false;}
// Original:
public String getKey() {return RawParseUtils.decode(enc, buffer, keyStart, keyEnd);}

// Translation:
public string GetKey(){return RawParseUtils.Decode(enc, buffer, keyStart, keyEnd);}
// Original:
public ValueEval evaluate(int srcRowIndex, int srcColumnIndex, ValueEval arg0, ValueEval arg1,ValueEval arg2, ValueEval arg3, ValueEval arg4) {double result;try {double d0 = NumericFunction.singleOperandEvaluate(arg0, srcRowIndex, srcColumnIndex);double d1 = NumericFunction.singleOperandEvaluate(arg1, srcRowIndex, srcColumnIndex);double d2 = NumericFunction.singleOperandEvaluate(arg2, srcRowIndex, srcColumnIndex);double d3 = NumericFunction.singleOperandEvaluate(arg3, srcRowIndex, srcColumnIndex);double d4 = NumericFunction.singleOperandEvaluate(arg4, srcRowIndex, srcColumnIndex);result = evaluate(d0, d1, d2, d3, d4 != 0.0);NumericFunction.checkValue(result);} catch (EvaluationException e) {return e.getErrorEval();}return new NumberEval(result);}

// Translation:
public ValueEval Evaluate(int srcRowIndex, int srcColumnIndex, ValueEval arg0, ValueEval arg1,ValueEval arg2, ValueEval arg3, ValueEval arg4){double result;try{double d0 = NumericFunction.SingleOperandEvaluate(arg0, srcRowIndex, srcColumnIndex);double d1 = NumericFunction.SingleOperandEvaluate(arg1, srcRowIndex, srcColumnIndex);double d2 = NumericFunction.SingleOperandEvaluate(arg2, srcRowIndex, srcColumnIndex);double d3 = NumericFunction.SingleOperandEvaluate(arg3, srcRowIndex, srcColumnIndex);double d4 = NumericFunction.SingleOperandEvaluate(arg4, srcRowIndex, srcColumnIndex);result = Evaluate(d0, d1, d2, d3, d4 != 0.0);NumericFunction.CheckValue(result);}catch (EvaluationException e){return e.GetErrorEval();}return new NumberEval(result);}
// Original:
public DeleteClientVpnEndpointResult deleteClientVpnEndpoint(DeleteClientVpnEndpointRequest request) {request = beforeClientExecution(request);return executeDeleteClientVpnEndpoint(request);}

// Translation:
public virtual DeleteClientVpnEndpointResponse DeleteClientVpnEndpoint(DeleteClientVpnEndpointRequest request){var options = new InvokeOptions();options.RequestMarshaller = DeleteClientVpnEndpointRequestMarshaller.Instance;options.ResponseUnmarshaller = DeleteClientVpnEndpointResponseUnmarshaller.Instance;return Invoke<DeleteClientVpnEndpointResponse>(request, options);}
// Original:
public Object get(CharSequence key) {List<TernaryTreeNode> list = autocomplete.prefixCompletion(root, key, 0);if (list == null || list.isEmpty()) {return null;}for (TernaryTreeNode n : list) {if (charSeqEquals(n.token, key)) {return n.val;}}return null;}

// Translation:
public virtual object Get(string key){IList<TernaryTreeNode> list = autocomplete.PrefixCompletion(root, key, 0);if (list == null || list.Count == 0){return null;}foreach (TernaryTreeNode n in list){if (CharSeqEquals(n.token, key)){return n.val;}}return null;}
// Original:
public StartFleetActionsResult startFleetActions(StartFleetActionsRequest request) {request = beforeClientExecution(request);return executeStartFleetActions(request);}

// Translation:
public virtual StartFleetActionsResponse StartFleetActions(StartFleetActionsRequest request){var options = new InvokeOptions();options.RequestMarshaller = StartFleetActionsRequestMarshaller.Instance;options.ResponseUnmarshaller = StartFleetActionsResponseUnmarshaller.Instance;return Invoke<StartFleetActionsResponse>(request, options);}
// Original:
public CellRangeAddress getCellRangeAddress(int index) {return _list.get(index);}

// Translation:
public CellRangeAddress GetCellRangeAddress(int index){return (CellRangeAddress)_list[index];}
// Original:
public static Document loadXML(Reader is) {DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();DocumentBuilder db = null;try {db = dbf.newDocumentBuilder();}catch (Exception se) {throw new RuntimeException("Parser configuration error", se);}org.w3c.dom.Document doc = null;try {doc = db.parse(new InputSource(is));}catch (Exception se) {throw new RuntimeException("Error parsing file:" + se, se);}return doc;}

// Translation:
public static XmlDocument LoadXML(TextReader input){XmlDocument result = new XmlDocument();try{result.Load(input);}catch (Exception se){throw new Exception("Error parsing file:" + se, se);}return result;}
// Original:
public double get(String name, double dflt) {double vals[] = (double[]) valByRound.get(name);if (vals != null) {return vals[roundNumber % vals.length];}String sval = props.getProperty(name, "" + dflt);if (sval.indexOf(":") < 0) {return Double.parseDouble(sval);}int k = sval.indexOf(":");String colName = sval.substring(0, k);sval = sval.substring(k + 1);colForValByRound.put(name, colName);vals = propToDoubleArray(sval);valByRound.put(name, vals);return vals[roundNumber % vals.length];}

// Translation:
public virtual int Get(string name, int dflt){int[] vals;object temp;if (valByRound.TryGetValue(name, out temp) && temp != null){vals = (int[])temp;return vals[roundNumber % vals.Length];}string sval;if (!props.TryGetValue(name, out sval)){sval = dflt.ToString(CultureInfo.InvariantCulture);}if (sval.IndexOf(':') < 0){return int.Parse(sval, CultureInfo.InvariantCulture);}int k = sval.IndexOf(':');string colName = sval.Substring(0, k - 0);sval = sval.Substring(k + 1);colForValByRound[name] = colName;vals = PropToInt32Array(sval);valByRound[name] = vals;return vals[roundNumber % vals.Length];}
// Original:
public int getBackgroundImageId(){EscherSimpleProperty property = getOptRecord().lookup(EscherPropertyTypes.FILL__PATTERNTEXTURE);return property == null ? 0 : property.getPropertyValue();}

// Translation:
public int GetBackgroundImageId(){EscherSimpleProperty property = (EscherSimpleProperty)GetOptRecord().Lookup(EscherProperties.FILL__PATTERNTEXTURE);return property == null ? 0 : property.PropertyValue;}
// Original:
public TreeFilter getTreeFilter() {return treeFilter;}

// Translation:
public virtual TreeFilter GetTreeFilter(){return treeFilter;}
// Original:
public GetMemberResult getMember(GetMemberRequest request) {request = beforeClientExecution(request);return executeGetMember(request);}

// Translation:
public virtual GetMemberResponse GetMember(GetMemberRequest request){var options = new InvokeOptions();options.RequestMarshaller = GetMemberRequestMarshaller.Instance;options.ResponseUnmarshaller = GetMemberResponseUnmarshaller.Instance;return Invoke<GetMemberResponse>(request, options);}
// Original:
public boolean canEncode() {return true;}

// Translation:
public virtual bool canEncode(){return true;}
// Original:
public ReplaceRouteResult replaceRoute(ReplaceRouteRequest request) {request = beforeClientExecution(request);return executeReplaceRoute(request);}

// Translation:
public virtual ReplaceRouteResponse ReplaceRoute(ReplaceRouteRequest request){var options = new InvokeOptions();options.RequestMarshaller = ReplaceRouteRequestMarshaller.Instance;options.ResponseUnmarshaller = ReplaceRouteResponseUnmarshaller.Instance;return Invoke<ReplaceRouteResponse>(request, options);}
// Original:
public ObjectId getResultTreeId() {return (resultTree == null) ? null : resultTree.toObjectId();}

// Translation:
public override ObjectId GetResultTreeId(){return (resultTree == null) ? null : resultTree.ToObjectId();}
// Original:
public boolean equals(final Object o){boolean rval = this == o;if (!rval && (o != null) && (o.getClass() == this.getClass())){IntList other = ( IntList ) o;if (other._limit == _limit){rval = true;for (int j = 0; rval && (j < _limit); j++){rval = _array[ j ] == other._array[ j ];}}}return rval;}

// Translation:
public override bool Equals(Object o){bool rval = this == o;if (!rval && (o != null) && (o.GetType() == this.GetType())){IntList other = (IntList)o;if (other._limit == _limit){rval = true;for (int j = 0; rval && (j < _limit); j++){rval = _array[j] == other._array[j];}}}return rval;}
// Original:
public ListReusableDelegationSetsResult listReusableDelegationSets(ListReusableDelegationSetsRequest request) {request = beforeClientExecution(request);return executeListReusableDelegationSets(request);}

// Translation:
public virtual ListReusableDelegationSetsResponse ListReusableDelegationSets(ListReusableDelegationSetsRequest request){var options = new InvokeOptions();options.RequestMarshaller = ListReusableDelegationSetsRequestMarshaller.Instance;options.ResponseUnmarshaller = ListReusableDelegationSetsResponseUnmarshaller.Instance;return Invoke<ListReusableDelegationSetsResponse>(request, options);}
// Original:
public String toString() {return "(" + a.toString() + " OR " + b.toString() + ")";}

// Translation:
public override string ToString(){return "(" + a.ToString() + " OR " + b.ToString() + ")";}
// Original:
public InitiateLayerUploadResult initiateLayerUpload(InitiateLayerUploadRequest request) {request = beforeClientExecution(request);return executeInitiateLayerUpload(request);}

// Translation:
public virtual InitiateLayerUploadResponse InitiateLayerUpload(InitiateLayerUploadRequest request){var options = new InvokeOptions();options.RequestMarshaller = InitiateLayerUploadRequestMarshaller.Instance;options.ResponseUnmarshaller = InitiateLayerUploadResponseUnmarshaller.Instance;return Invoke<InitiateLayerUploadResponse>(request, options);}
// Original:
public UpdateRepoRequest() {super("cr", "2016-06-07", "UpdateRepo", "cr");setUriPattern("/repos/[RepoNamespace]/[RepoName]");setMethod(MethodType.POST);}

// Translation:
public UpdateRepoRequest(): base("cr", "2016-06-07", "UpdateRepo", "cr", "openAPI"){UriPattern = "/repos/[RepoNamespace]/[RepoName]";Method = MethodType.POST;}
// Original:
public PhoneticFilterFactory(Map<String,String> args) {super(args);inject = getBoolean(args, INJECT, true);name = require(args, ENCODER);String v = get(args, MAX_CODE_LENGTH);if (v != null) {maxCodeLength = Integer.valueOf(v);} else {maxCodeLength = null;}if (!args.isEmpty()) {throw new IllegalArgumentException("Unknown parameters: " + args);}}

// Translation:
public PhoneticFilterFactory(IDictionary<string, string> args): base(args){inject = GetBoolean(args, INJECT, true);name = Require(args, ENCODER);string v = Get(args, MAX_CODE_LENGTH);if (v != null){maxCodeLength = int.Parse(v, CultureInfo.InvariantCulture);}else{maxCodeLength = null;}if (!(args.Count == 0)){throw new ArgumentException("Unknown parameters: " + args);}}
// Original:
public FetchCommand fetch() {return new FetchCommand(repo);}

// Translation:
public virtual FetchCommand Fetch(){return new FetchCommand(repo);}
// Original:
public QueryPhraseMap searchPhrase( String fieldName, final List<TermInfo> phraseCandidate ){QueryPhraseMap root = getRootMap( fieldName );if( root == null ) return null;return root.searchPhrase( phraseCandidate );}

// Translation:
public virtual QueryPhraseMap SearchPhrase(string fieldName, IList<TermInfo> phraseCandidate){QueryPhraseMap root = GetRootMap(fieldName);if (root == null) return null;return root.SearchPhrase(phraseCandidate);}
// Original:
@Override public Iterator<Multiset.Entry<K>> iterator() {return new MultisetEntryIterator();}

// Translation:
public override java.util.Iterator<java.util.MapClass.Entry<K, V>> iterator(){return new java.util.Hashtable<K, V>.EntryIterator(this._enclosing);}
// Original:
public DBSnapshot deleteDBSnapshot(DeleteDBSnapshotRequest request) {request = beforeClientExecution(request);return executeDeleteDBSnapshot(request);}

// Translation:
public virtual DeleteDBSnapshotResponse DeleteDBSnapshot(DeleteDBSnapshotRequest request){var options = new InvokeOptions();options.RequestMarshaller = DeleteDBSnapshotRequestMarshaller.Instance;options.ResponseUnmarshaller = DeleteDBSnapshotResponseUnmarshaller.Instance;return Invoke<DeleteDBSnapshotResponse>(request, options);}
// Original:
public void setOutput() {output = true;}

// Translation:
public virtual void SetOutput(){output = true;}
// Original:
public ByteBuffer compact() {throw new ReadOnlyBufferException();}

// Translation:
public override java.nio.ByteBuffer compact(){throw new System.NotImplementedException();}
// Original:
public XmlPullParser newPullParser() throws XmlPullParserException {if (parserClasses == null) throw new XmlPullParserException("Factory initialization was incomplete - has not tried "+classNamesLocation);if (parserClasses.size() == 0) throw new XmlPullParserException("No valid parser classes found in "+classNamesLocation);final StringBuilder issues = new StringBuilder();for (int i = 0; i < parserClasses.size(); i++) {final Class ppClass = (Class) parserClasses.get(i);try {final XmlPullParser pp = (XmlPullParser) ppClass.newInstance();for (Iterator iter = features.keySet().iterator(); iter.hasNext(); ) {final String key = (String) iter.next();final Boolean value = (Boolean) features.get(key);if(value != null && value.booleanValue()) {pp.setFeature(key, true);}}return pp;} catch(Exception ex) {issues.append (ppClass.getName () + ": "+ ex.toString ()+"; ");}}throw new XmlPullParserException ("could not create parser: "+issues);}

// Translation:
public virtual org.xmlpull.v1.XmlPullParser newPullParser(){if (parserClasses == null){throw new org.xmlpull.v1.XmlPullParserException("Factory initialization was incomplete - has not tried "+ classNamesLocation);}if (parserClasses.size() == 0){throw new org.xmlpull.v1.XmlPullParserException("No valid parser classes found in "+ classNamesLocation);}java.lang.StringBuilder issues = new java.lang.StringBuilder();{for (int i = 0; i < parserClasses.size(); i++){System.Type ppClass = (System.Type)parserClasses.get(i);try{org.xmlpull.v1.XmlPullParser pp = (org.xmlpull.v1.XmlPullParser)System.Activator.CreateInstance(ppClass);{for (java.util.Iterator<object> iter = features.keySet().iterator(); iter.hasNext(); ){string key = (string)iter.next();bool value = (bool)features.get(key);if (value != null && value){pp.setFeature(key, true);}}}return pp;}catch (System.Exception ex){issues.append(ppClass.FullName + ": " + ex.ToString() + "; ");}}}throw new org.xmlpull.v1.XmlPullParserException("could not create parser: " + issues);}
// Original:
public DeleteAnalysisSchemeResult deleteAnalysisScheme(DeleteAnalysisSchemeRequest request) {request = beforeClientExecution(request);return executeDeleteAnalysisScheme(request);}

// Translation:
public virtual DeleteAnalysisSchemeResponse DeleteAnalysisScheme(DeleteAnalysisSchemeRequest request){var options = new InvokeOptions();options.RequestMarshaller = DeleteAnalysisSchemeRequestMarshaller.Instance;options.ResponseUnmarshaller = DeleteAnalysisSchemeResponseUnmarshaller.Instance;return Invoke<DeleteAnalysisSchemeResponse>(request, options);}
// Original:
public ExcelExtractor(HSSFWorkbook wb) {super(wb);_wb = wb;_formatter = new HSSFDataFormatter();}

// Translation:
public ExcelExtractor(HSSFWorkbook wb): base(wb){this.wb = wb;_formatter = new HSSFDataFormatter();}
// Original:
public IntBuffer put(int index, int c) {checkIndex(index);byteBuffer.putInt(index * SizeOf.INT, c);return this;}

// Translation:
public override java.nio.IntBuffer put(int index, int c){checkIndex(index);byteBuffer.putInt(index * libcore.io.SizeOf.INT, c);return this;}
// Original:
public final byte getParameterClass(int index) {if (index >= paramClass.length) {return paramClass[paramClass.length - 1];}return paramClass[index];}

// Translation:
public byte GetParameterClass(int index){if (index >= paramClass.Length){return paramClass[paramClass.Length - 1];}return paramClass[index];}
// Original:
public ListEndpointsResult listEndpoints(ListEndpointsRequest request) {request = beforeClientExecution(request);return executeListEndpoints(request);}

// Translation:
public virtual ListEndpointsResponse ListEndpoints(ListEndpointsRequest request){var options = new InvokeOptions();options.RequestMarshaller = ListEndpointsRequestMarshaller.Instance;options.ResponseUnmarshaller = ListEndpointsResponseUnmarshaller.Instance;return Invoke<ListEndpointsResponse>(request, options);}
// Original:
public static CharsRef join(String[] words, CharsRefBuilder reuse) {int upto = 0;char[] buffer = reuse.chars();for (String word : words) {final int wordLen = word.length();final int needed = (0 == upto ? wordLen : 1 + upto + wordLen); if (needed > buffer.length) {reuse.grow(needed);buffer = reuse.chars();}if (upto > 0) {buffer[upto++] = SynonymMap.WORD_SEPARATOR;}word.getChars(0, wordLen, buffer, upto);upto += wordLen;}reuse.setLength(upto);return reuse.get();}

// Translation:
public static CharsRef Join(string[] words, CharsRef reuse){int upto = 0;char[] buffer = reuse.Chars;foreach (string word in words){int wordLen = word.Length;int needed = (0 == upto ? wordLen : 1 + upto + wordLen); if (needed > buffer.Length){reuse.Grow(needed);buffer = reuse.Chars;}if (upto > 0){buffer[upto++] = SynonymMap.WORD_SEPARATOR;}word.CopyTo(0, buffer, upto, wordLen - 0);upto += wordLen;}reuse.Length = upto;return reuse;}
// Original:
public StringBuffer insert(int index, float f) {return insert(index, Float.toString(f));}

// Translation:
public java.lang.StringBuffer insert(int index, float f){return insert(index, System.Convert.ToString(f));}
// Original:
public ShortBuffer put(short[] src, int srcOffset, int shortCount) {if (shortCount > remaining()) {throw new BufferOverflowException();}System.arraycopy(src, srcOffset, backingArray, offset + position, shortCount);position += shortCount;return this;}

// Translation:
public override java.nio.ShortBuffer put(short[] src, int srcOffset, int shortCount){if (shortCount > remaining()){throw new java.nio.BufferOverflowException();}System.Array.Copy(src, srcOffset, backingArray, offset + _position, shortCount);_position += shortCount;return this;}
// Original:
public DisassociateResolverEndpointIpAddressResult disassociateResolverEndpointIpAddress(DisassociateResolverEndpointIpAddressRequest request) {request = beforeClientExecution(request);return executeDisassociateResolverEndpointIpAddress(request);}

// Translation:
public virtual DisassociateResolverEndpointIpAddressResponse DisassociateResolverEndpointIpAddress(DisassociateResolverEndpointIpAddressRequest request){var options = new InvokeOptions();options.RequestMarshaller = DisassociateResolverEndpointIpAddressRequestMarshaller.Instance;options.ResponseUnmarshaller = DisassociateResolverEndpointIpAddressResponseUnmarshaller.Instance;return Invoke<DisassociateResolverEndpointIpAddressResponse>(request, options);}
// Original:
public AcceptDirectConnectGatewayAssociationProposalResult acceptDirectConnectGatewayAssociationProposal(AcceptDirectConnectGatewayAssociationProposalRequest request) {request = beforeClientExecution(request);return executeAcceptDirectConnectGatewayAssociationProposal(request);}

// Translation:
public virtual AcceptDirectConnectGatewayAssociationProposalResponse AcceptDirectConnectGatewayAssociationProposal(AcceptDirectConnectGatewayAssociationProposalRequest request){var options = new InvokeOptions();options.RequestMarshaller = AcceptDirectConnectGatewayAssociationProposalRequestMarshaller.Instance;options.ResponseUnmarshaller = AcceptDirectConnectGatewayAssociationProposalResponseUnmarshaller.Instance;return Invoke<AcceptDirectConnectGatewayAssociationProposalResponse>(request, options);}
// Original:
public StopStackSetOperationResult stopStackSetOperation(StopStackSetOperationRequest request) {request = beforeClientExecution(request);return executeStopStackSetOperation(request);}

// Translation:
public virtual StopStackSetOperationResponse StopStackSetOperation(StopStackSetOperationRequest request){var options = new InvokeOptions();options.RequestMarshaller = StopStackSetOperationRequestMarshaller.Instance;options.ResponseUnmarshaller = StopStackSetOperationResponseUnmarshaller.Instance;return Invoke<StopStackSetOperationResponse>(request, options);}
// Original:
public CacheSubnetGroup createCacheSubnetGroup(CreateCacheSubnetGroupRequest request) {request = beforeClientExecution(request);return executeCreateCacheSubnetGroup(request);}

// Translation:
public virtual CreateCacheSubnetGroupResponse CreateCacheSubnetGroup(CreateCacheSubnetGroupRequest request){var options = new InvokeOptions();options.RequestMarshaller = CreateCacheSubnetGroupRequestMarshaller.Instance;options.ResponseUnmarshaller = CreateCacheSubnetGroupResponseUnmarshaller.Instance;return Invoke<CreateCacheSubnetGroupResponse>(request, options);}
// Original:
public CachedOrds(OrdinalsSegmentReader source, int maxDoc) throws IOException {offsets = new int[maxDoc + 1];int[] ords = new int[maxDoc]; long totOrds = 0;final IntsRef values = new IntsRef(32);for (int docID = 0; docID < maxDoc; docID++) {offsets[docID] = (int) totOrds;source.get(docID, values);long nextLength = totOrds + values.length;if (nextLength > ords.length) {if (nextLength > ArrayUtil.MAX_ARRAY_LENGTH) {throw new IllegalStateException("too many ordinals (>= " + nextLength + ") to cache");}ords = ArrayUtil.grow(ords, (int) nextLength);}System.arraycopy(values.ints, 0, ords, (int) totOrds, values.length);totOrds = nextLength;}offsets[maxDoc] = (int) totOrds;if ((double) totOrds / ords.length < 0.9) {this.ordinals = new int[(int) totOrds];System.arraycopy(ords, 0, this.ordinals, 0, (int) totOrds);} else {this.ordinals = ords;}}

// Translation:
public CachedOrds(OrdinalsSegmentReader source, int maxDoc){Offsets = new int[maxDoc + 1];int[] ords = new int[maxDoc]; long totOrds = 0;Int32sRef values = new Int32sRef(32);for (int docID = 0; docID < maxDoc; docID++){Offsets[docID] = (int)totOrds;source.Get(docID, values);long nextLength = totOrds + values.Length;if (nextLength > ords.Length){if (nextLength > ArrayUtil.MAX_ARRAY_LENGTH){throw new ThreadStateException("too many ordinals (>= " + nextLength + ") to cache");}ords = ArrayUtil.Grow(ords, (int)nextLength);}Array.Copy(values.Int32s, 0, ords, (int)totOrds, values.Length);totOrds = nextLength;}Offsets[maxDoc] = (int)totOrds;if ((double)totOrds / ords.Length < 0.9){this.Ordinals = new int[(int)totOrds];Array.Copy(ords, 0, this.Ordinals, 0, (int)totOrds);}else{this.Ordinals = ords;}}
// Original:
public String getRawUserInfo() {return userInfo;}

// Translation:
public string getRawUserInfo(){return userInfo;}
// Original:
@Override public Object[] toArray() {return ObjectArrays.toArrayImpl(this);}

// Translation:
public override object[] toArray(){lock (this._enclosing){return base.toArray();}}