Dataset Viewer
Auto-converted to Parquet Duplicate
input
stringlengths
72
1.11k
output
stringlengths
39
1.04k
Translate the following Java code to C#: 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);}
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);}
Translate the following Java code to C#: public String toString() {return pattern();}
public override string ToString(){return Pattern();}
Translate the following Java code to C#: public InsertInstanceRequest() {super("Ots", "2016-06-20", "InsertInstance", "ots");setMethod(MethodType.POST);}
public InsertInstanceRequest(): base("Ots", "2016-06-20", "InsertInstance", "ots", "openAPI"){Method = MethodType.POST;}
Translate the following Java code to C#: public boolean contains(Object o) {return indexOf(o) != -1;}
public virtual bool contains(object o){return indexOf(o) != -1;}
Translate the following Java code to C#: public final ByteBuffer encode(String s) {return encode(CharBuffer.wrap(s));}
public java.nio.ByteBuffer encode(string s){return encode(java.nio.CharBuffer.wrap(java.lang.CharSequenceProxy.Wrap(s)));}
Translate the following Java code to C#: public boolean requiresCommitBody() {return false;}
public override bool RequiresCommitBody(){return false;}
Translate the following Java code to C#: public String getKey() {return RawParseUtils.decode(enc, buffer, keyStart, keyEnd);}
public string GetKey(){return RawParseUtils.Decode(enc, buffer, keyStart, keyEnd);}
Translate the following Java code to C#: 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);}
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);}
Translate the following Java code to C#: public DeleteClientVpnEndpointResult deleteClientVpnEndpoint(DeleteClientVpnEndpointRequest request) {request = beforeClientExecution(request);return executeDeleteClientVpnEndpoint(request);}
public virtual DeleteClientVpnEndpointResponse DeleteClientVpnEndpoint(DeleteClientVpnEndpointRequest request){var options = new InvokeOptions();options.RequestMarshaller = DeleteClientVpnEndpointRequestMarshaller.Instance;options.ResponseUnmarshaller = DeleteClientVpnEndpointResponseUnmarshaller.Instance;return Invoke<DeleteClientVpnEndpointResponse>(request, options);}
Translate the following Java code to C#: 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;}
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;}
Translate the following Java code to C#: public StartFleetActionsResult startFleetActions(StartFleetActionsRequest request) {request = beforeClientExecution(request);return executeStartFleetActions(request);}
public virtual StartFleetActionsResponse StartFleetActions(StartFleetActionsRequest request){var options = new InvokeOptions();options.RequestMarshaller = StartFleetActionsRequestMarshaller.Instance;options.ResponseUnmarshaller = StartFleetActionsResponseUnmarshaller.Instance;return Invoke<StartFleetActionsResponse>(request, options);}
Translate the following Java code to C#: public CellRangeAddress getCellRangeAddress(int index) {return _list.get(index);}
public CellRangeAddress GetCellRangeAddress(int index){return (CellRangeAddress)_list[index];}
Translate the following Java code to C#: 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;}
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;}
Translate the following Java code to C#: 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];}
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];}
Translate the following Java code to C#: public int getBackgroundImageId(){EscherSimpleProperty property = getOptRecord().lookup(EscherPropertyTypes.FILL__PATTERNTEXTURE);return property == null ? 0 : property.getPropertyValue();}
public int GetBackgroundImageId(){EscherSimpleProperty property = (EscherSimpleProperty)GetOptRecord().Lookup(EscherProperties.FILL__PATTERNTEXTURE);return property == null ? 0 : property.PropertyValue;}
Translate the following Java code to C#: public TreeFilter getTreeFilter() {return treeFilter;}
public virtual TreeFilter GetTreeFilter(){return treeFilter;}
Translate the following Java code to C#: public GetMemberResult getMember(GetMemberRequest request) {request = beforeClientExecution(request);return executeGetMember(request);}
public virtual GetMemberResponse GetMember(GetMemberRequest request){var options = new InvokeOptions();options.RequestMarshaller = GetMemberRequestMarshaller.Instance;options.ResponseUnmarshaller = GetMemberResponseUnmarshaller.Instance;return Invoke<GetMemberResponse>(request, options);}
Translate the following Java code to C#: public boolean canEncode() {return true;}
public virtual bool canEncode(){return true;}
Translate the following Java code to C#: public ReplaceRouteResult replaceRoute(ReplaceRouteRequest request) {request = beforeClientExecution(request);return executeReplaceRoute(request);}
public virtual ReplaceRouteResponse ReplaceRoute(ReplaceRouteRequest request){var options = new InvokeOptions();options.RequestMarshaller = ReplaceRouteRequestMarshaller.Instance;options.ResponseUnmarshaller = ReplaceRouteResponseUnmarshaller.Instance;return Invoke<ReplaceRouteResponse>(request, options);}
Translate the following Java code to C#: public ObjectId getResultTreeId() {return (resultTree == null) ? null : resultTree.toObjectId();}
public override ObjectId GetResultTreeId(){return (resultTree == null) ? null : resultTree.ToObjectId();}
Translate the following Java code to C#: 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;}
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;}
Translate the following Java code to C#: public ListReusableDelegationSetsResult listReusableDelegationSets(ListReusableDelegationSetsRequest request) {request = beforeClientExecution(request);return executeListReusableDelegationSets(request);}
public virtual ListReusableDelegationSetsResponse ListReusableDelegationSets(ListReusableDelegationSetsRequest request){var options = new InvokeOptions();options.RequestMarshaller = ListReusableDelegationSetsRequestMarshaller.Instance;options.ResponseUnmarshaller = ListReusableDelegationSetsResponseUnmarshaller.Instance;return Invoke<ListReusableDelegationSetsResponse>(request, options);}
Translate the following Java code to C#: public String toString() {return "(" + a.toString() + " OR " + b.toString() + ")";}
public override string ToString(){return "(" + a.ToString() + " OR " + b.ToString() + ")";}
Translate the following Java code to C#: public InitiateLayerUploadResult initiateLayerUpload(InitiateLayerUploadRequest request) {request = beforeClientExecution(request);return executeInitiateLayerUpload(request);}
public virtual InitiateLayerUploadResponse InitiateLayerUpload(InitiateLayerUploadRequest request){var options = new InvokeOptions();options.RequestMarshaller = InitiateLayerUploadRequestMarshaller.Instance;options.ResponseUnmarshaller = InitiateLayerUploadResponseUnmarshaller.Instance;return Invoke<InitiateLayerUploadResponse>(request, options);}
Translate the following Java code to C#: public UpdateRepoRequest() {super("cr", "2016-06-07", "UpdateRepo", "cr");setUriPattern("/repos/[RepoNamespace]/[RepoName]");setMethod(MethodType.POST);}
public UpdateRepoRequest(): base("cr", "2016-06-07", "UpdateRepo", "cr", "openAPI"){UriPattern = "/repos/[RepoNamespace]/[RepoName]";Method = MethodType.POST;}
Translate the following Java code to C#: 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);}}
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);}}
Translate the following Java code to C#: public FetchCommand fetch() {return new FetchCommand(repo);}
public virtual FetchCommand Fetch(){return new FetchCommand(repo);}
Translate the following Java code to C#: public QueryPhraseMap searchPhrase( String fieldName, final List<TermInfo> phraseCandidate ){QueryPhraseMap root = getRootMap( fieldName );if( root == null ) return null;return root.searchPhrase( phraseCandidate );}
public virtual QueryPhraseMap SearchPhrase(string fieldName, IList<TermInfo> phraseCandidate){QueryPhraseMap root = GetRootMap(fieldName);if (root == null) return null;return root.SearchPhrase(phraseCandidate);}
Translate the following Java code to C#: @Override public Iterator<Multiset.Entry<K>> iterator() {return new MultisetEntryIterator();}
public override java.util.Iterator<java.util.MapClass.Entry<K, V>> iterator(){return new java.util.Hashtable<K, V>.EntryIterator(this._enclosing);}
Translate the following Java code to C#: public DBSnapshot deleteDBSnapshot(DeleteDBSnapshotRequest request) {request = beforeClientExecution(request);return executeDeleteDBSnapshot(request);}
public virtual DeleteDBSnapshotResponse DeleteDBSnapshot(DeleteDBSnapshotRequest request){var options = new InvokeOptions();options.RequestMarshaller = DeleteDBSnapshotRequestMarshaller.Instance;options.ResponseUnmarshaller = DeleteDBSnapshotResponseUnmarshaller.Instance;return Invoke<DeleteDBSnapshotResponse>(request, options);}
Translate the following Java code to C#: public void setOutput() {output = true;}
public virtual void SetOutput(){output = true;}
Translate the following Java code to C#: public ByteBuffer compact() {throw new ReadOnlyBufferException();}
public override java.nio.ByteBuffer compact(){throw new System.NotImplementedException();}
Translate the following Java code to C#: 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);}
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);}
Translate the following Java code to C#: public DeleteAnalysisSchemeResult deleteAnalysisScheme(DeleteAnalysisSchemeRequest request) {request = beforeClientExecution(request);return executeDeleteAnalysisScheme(request);}
public virtual DeleteAnalysisSchemeResponse DeleteAnalysisScheme(DeleteAnalysisSchemeRequest request){var options = new InvokeOptions();options.RequestMarshaller = DeleteAnalysisSchemeRequestMarshaller.Instance;options.ResponseUnmarshaller = DeleteAnalysisSchemeResponseUnmarshaller.Instance;return Invoke<DeleteAnalysisSchemeResponse>(request, options);}
Translate the following Java code to C#: public ExcelExtractor(HSSFWorkbook wb) {super(wb);_wb = wb;_formatter = new HSSFDataFormatter();}
public ExcelExtractor(HSSFWorkbook wb): base(wb){this.wb = wb;_formatter = new HSSFDataFormatter();}
Translate the following Java code to C#: public IntBuffer put(int index, int c) {checkIndex(index);byteBuffer.putInt(index * SizeOf.INT, c);return this;}
public override java.nio.IntBuffer put(int index, int c){checkIndex(index);byteBuffer.putInt(index * libcore.io.SizeOf.INT, c);return this;}
Translate the following Java code to C#: public final byte getParameterClass(int index) {if (index >= paramClass.length) {return paramClass[paramClass.length - 1];}return paramClass[index];}
public byte GetParameterClass(int index){if (index >= paramClass.Length){return paramClass[paramClass.Length - 1];}return paramClass[index];}
Translate the following Java code to C#: public ListEndpointsResult listEndpoints(ListEndpointsRequest request) {request = beforeClientExecution(request);return executeListEndpoints(request);}
public virtual ListEndpointsResponse ListEndpoints(ListEndpointsRequest request){var options = new InvokeOptions();options.RequestMarshaller = ListEndpointsRequestMarshaller.Instance;options.ResponseUnmarshaller = ListEndpointsResponseUnmarshaller.Instance;return Invoke<ListEndpointsResponse>(request, options);}
Translate the following Java code to C#: 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();}
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;}
Translate the following Java code to C#: public StringBuffer insert(int index, float f) {return insert(index, Float.toString(f));}
public java.lang.StringBuffer insert(int index, float f){return insert(index, System.Convert.ToString(f));}
Translate the following Java code to C#: 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;}
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;}
Translate the following Java code to C#: public DisassociateResolverEndpointIpAddressResult disassociateResolverEndpointIpAddress(DisassociateResolverEndpointIpAddressRequest request) {request = beforeClientExecution(request);return executeDisassociateResolverEndpointIpAddress(request);}
public virtual DisassociateResolverEndpointIpAddressResponse DisassociateResolverEndpointIpAddress(DisassociateResolverEndpointIpAddressRequest request){var options = new InvokeOptions();options.RequestMarshaller = DisassociateResolverEndpointIpAddressRequestMarshaller.Instance;options.ResponseUnmarshaller = DisassociateResolverEndpointIpAddressResponseUnmarshaller.Instance;return Invoke<DisassociateResolverEndpointIpAddressResponse>(request, options);}
Translate the following Java code to C#: public AcceptDirectConnectGatewayAssociationProposalResult acceptDirectConnectGatewayAssociationProposal(AcceptDirectConnectGatewayAssociationProposalRequest request) {request = beforeClientExecution(request);return executeAcceptDirectConnectGatewayAssociationProposal(request);}
public virtual AcceptDirectConnectGatewayAssociationProposalResponse AcceptDirectConnectGatewayAssociationProposal(AcceptDirectConnectGatewayAssociationProposalRequest request){var options = new InvokeOptions();options.RequestMarshaller = AcceptDirectConnectGatewayAssociationProposalRequestMarshaller.Instance;options.ResponseUnmarshaller = AcceptDirectConnectGatewayAssociationProposalResponseUnmarshaller.Instance;return Invoke<AcceptDirectConnectGatewayAssociationProposalResponse>(request, options);}
Translate the following Java code to C#: public StopStackSetOperationResult stopStackSetOperation(StopStackSetOperationRequest request) {request = beforeClientExecution(request);return executeStopStackSetOperation(request);}
public virtual StopStackSetOperationResponse StopStackSetOperation(StopStackSetOperationRequest request){var options = new InvokeOptions();options.RequestMarshaller = StopStackSetOperationRequestMarshaller.Instance;options.ResponseUnmarshaller = StopStackSetOperationResponseUnmarshaller.Instance;return Invoke<StopStackSetOperationResponse>(request, options);}
Translate the following Java code to C#: public CacheSubnetGroup createCacheSubnetGroup(CreateCacheSubnetGroupRequest request) {request = beforeClientExecution(request);return executeCreateCacheSubnetGroup(request);}
public virtual CreateCacheSubnetGroupResponse CreateCacheSubnetGroup(CreateCacheSubnetGroupRequest request){var options = new InvokeOptions();options.RequestMarshaller = CreateCacheSubnetGroupRequestMarshaller.Instance;options.ResponseUnmarshaller = CreateCacheSubnetGroupResponseUnmarshaller.Instance;return Invoke<CreateCacheSubnetGroupResponse>(request, options);}
Translate the following Java code to C#: 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;}}
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;}}
Translate the following Java code to C#: public String getRawUserInfo() {return userInfo;}
public string getRawUserInfo(){return userInfo;}
Translate the following Java code to C#: @Override public Object[] toArray() {return ObjectArrays.toArrayImpl(this);}
public override object[] toArray(){lock (this._enclosing){return base.toArray();}}
Translate the following Java code to C#: public DescribeCompilationJobResult describeCompilationJob(DescribeCompilationJobRequest request) {request = beforeClientExecution(request);return executeDescribeCompilationJob(request);}
public virtual DescribeCompilationJobResponse DescribeCompilationJob(DescribeCompilationJobRequest request){var options = new InvokeOptions();options.RequestMarshaller = DescribeCompilationJobRequestMarshaller.Instance;options.ResponseUnmarshaller = DescribeCompilationJobResponseUnmarshaller.Instance;return Invoke<DescribeCompilationJobResponse>(request, options);}
Translate the following Java code to C#: public String getQuery() {return decode(query);}
public string getQuery(){return decode(query);}
Translate the following Java code to C#: public CreateEnvironmentResult createEnvironment(CreateEnvironmentRequest request) {request = beforeClientExecution(request);return executeCreateEnvironment(request);}
public virtual CreateEnvironmentResponse CreateEnvironment(CreateEnvironmentRequest request){var options = new InvokeOptions();options.RequestMarshaller = CreateEnvironmentRequestMarshaller.Instance;options.ResponseUnmarshaller = CreateEnvironmentResponseUnmarshaller.Instance;return Invoke<CreateEnvironmentResponse>(request, options);}
Translate the following Java code to C#: public ParseTreeMatch match(ParseTree tree) {return matcher.match(tree, this);}
public virtual ParseTreeMatch Match(IParseTree tree){return matcher.Match(tree, this);}
Translate the following Java code to C#: public boolean contains(CharSequence cs) {return map.containsKey(cs);}
public virtual bool Contains(char[] text){return map.ContainsKey(text, 0, text.Length);}
Translate the following Java code to C#: public QueryRequest(String tableName) {setTableName(tableName);}
public QueryRequest(string tableName){_tableName = tableName;}
Translate the following Java code to C#: public boolean isRowGroupHiddenByParent(int row) {int endLevel;boolean endHidden;int endOfOutlineGroupIdx = findEndOfRowOutlineGroup(row);if (getRow(endOfOutlineGroupIdx + 1) == null) {endLevel = 0;endHidden = false;} else {endLevel = getRow(endOfOutlineGroupIdx + 1).getOutlineLevel();endHidden = getRow(endOfOutlineGroupIdx + 1).getZeroHeight();}int startLevel;boolean startHidden;int startOfOutlineGroupIdx = findStartOfRowOutlineGroup( row );if (startOfOutlineGroupIdx - 1 < 0 || getRow(startOfOutlineGroupIdx - 1) == null) {startLevel = 0;startHidden = false;} else {startLevel = getRow(startOfOutlineGroupIdx - 1).getOutlineLevel();startHidden = getRow(startOfOutlineGroupIdx - 1).getZeroHeight();}if (endLevel > startLevel) {return endHidden;}return startHidden;}
public bool IsRowGroupHiddenByParent(int row){int endLevel;bool endHidden;int endOfOutlineGroupIdx = FindEndOfRowOutlineGroup(row);if (GetRow(endOfOutlineGroupIdx + 1) == null){endLevel = 0;endHidden = false;}else{endLevel = GetRow(endOfOutlineGroupIdx + 1).OutlineLevel;endHidden = GetRow(endOfOutlineGroupIdx + 1).ZeroHeight;}int startLevel;bool startHidden;int startOfOutlineGroupIdx = FindStartOfRowOutlineGroup(row);if (startOfOutlineGroupIdx - 1 < 0 || GetRow(startOfOutlineGroupIdx - 1) == null){startLevel = 0;startHidden = false;}else{startLevel = GetRow(startOfOutlineGroupIdx - 1).OutlineLevel;startHidden = GetRow(startOfOutlineGroupIdx - 1).ZeroHeight;}if (endLevel > startLevel){return endHidden;}else{return startHidden;}}
Translate the following Java code to C#: public boolean retryFailedLockFileCommit() {return true;}
public override bool RetryFailedLockFileCommit(){return true;}
Translate the following Java code to C#: public ValidateMatchmakingRuleSetResult validateMatchmakingRuleSet(ValidateMatchmakingRuleSetRequest request) {request = beforeClientExecution(request);return executeValidateMatchmakingRuleSet(request);}
public virtual ValidateMatchmakingRuleSetResponse ValidateMatchmakingRuleSet(ValidateMatchmakingRuleSetRequest request){var options = new InvokeOptions();options.RequestMarshaller = ValidateMatchmakingRuleSetRequestMarshaller.Instance;options.ResponseUnmarshaller = ValidateMatchmakingRuleSetResponseUnmarshaller.Instance;return Invoke<ValidateMatchmakingRuleSetResponse>(request, options);}
Translate the following Java code to C#: public boolean get(String name, boolean dflt) {boolean vals[] = (boolean[]) valByRound.get(name);if (vals != null) {return vals[roundNumber % vals.length];}String sval = props.getProperty(name, "" + dflt);if (sval.indexOf(":") < 0) {return Boolean.valueOf(sval).booleanValue();}int k = sval.indexOf(":");String colName = sval.substring(0, k);sval = sval.substring(k + 1);colForValByRound.put(name, colName);vals = propToBooleanArray(sval);valByRound.put(name, vals);return vals[roundNumber % vals.length];}
public virtual bool Get(string name, bool dflt){bool[] vals;object temp;if (valByRound.TryGetValue(name, out temp) && temp != null){vals = (bool[])temp;return vals[roundNumber % vals.Length];}string sval;if (!props.TryGetValue(name, out sval)){sval = dflt.ToString(); }if (sval.IndexOf(':') < 0){return bool.Parse(sval);}int k = sval.IndexOf(':');string colName = sval.Substring(0, k - 0);sval = sval.Substring(k + 1);colForValByRound[name] = colName;vals = PropToBooleanArray(sval);valByRound[name] = vals;return vals[roundNumber % vals.Length];}
Translate the following Java code to C#: public UpdateLinkAttributesResult updateLinkAttributes(UpdateLinkAttributesRequest request) {request = beforeClientExecution(request);return executeUpdateLinkAttributes(request);}
public virtual UpdateLinkAttributesResponse UpdateLinkAttributes(UpdateLinkAttributesRequest request){var options = new InvokeOptions();options.RequestMarshaller = UpdateLinkAttributesRequestMarshaller.Instance;options.ResponseUnmarshaller = UpdateLinkAttributesResponseUnmarshaller.Instance;return Invoke<UpdateLinkAttributesResponse>(request, options);}
Translate the following Java code to C#: public NumericPayloadTokenFilter(TokenStream input, float payload, String typeMatch) {super(input);if (typeMatch == null) {throw new IllegalArgumentException("typeMatch must not be null");}thePayload = new BytesRef(PayloadHelper.encodeFloat(payload));this.typeMatch = typeMatch;}
public NumericPayloadTokenFilter(TokenStream input, float payload, string typeMatch): base(input){if (typeMatch == null){throw new ArgumentException("typeMatch cannot be null");}thePayload = new BytesRef(PayloadHelper.EncodeSingle(payload));this.typeMatch = typeMatch;this.payloadAtt = AddAttribute<IPayloadAttribute>();this.typeAtt = AddAttribute<ITypeAttribute>();}
Translate the following Java code to C#: public String toString(){StringBuilder buffer = new StringBuilder();buffer.append("[CALCCOUNT]\n");buffer.append(" .iterations = ").append(Integer.toHexString(getIterations())).append("\n");buffer.append("[/CALCCOUNT]\n");return buffer.toString();}
public override String ToString(){StringBuilder buffer = new StringBuilder();buffer.Append("[CALCCOUNT]\n");buffer.Append(" .iterations = ").Append(StringUtil.ToHexString(Iterations)).Append("\n");buffer.Append("[/CALCCOUNT]\n");return buffer.ToString();}
Translate the following Java code to C#: public E push(E object) {addElement(object);return object;}
public virtual E push(E @object){addElement(@object);return @object;}
Translate the following Java code to C#: public LinkedHashMap(int initialCapacity, float loadFactor, boolean accessOrder) {super(initialCapacity, loadFactor);init();this.accessOrder = accessOrder;}
public LinkedHashMap(int initialCapacity, float loadFactor, bool accessOrder) : base(initialCapacity, loadFactor){init();this.accessOrder = accessOrder;}
Translate the following Java code to C#: public TreeSet() {backingMap = new TreeMap<E, Object>();}
public TreeSet(){backingMap = new java.util.TreeMap<E, object>();}
Translate the following Java code to C#: public long skip(long charCount) throws IOException {if (charCount < 0) {throw new IllegalArgumentException("charCount < 0: " + charCount);}synchronized (lock) {long skipped = 0;int toRead = charCount < 512 ? (int) charCount : 512;char[] charsSkipped = new char[toRead];while (skipped < charCount) {int read = read(charsSkipped, 0, toRead);if (read == -1) {return skipped;}skipped += read;if (read < toRead) {return skipped;}if (charCount - skipped < toRead) {toRead = (int) (charCount - skipped);}}return skipped;}}
public virtual long skip(long charCount){if (charCount < 0){throw new System.ArgumentException("charCount < 0: " + charCount);}lock (@lock){long skipped = 0;int toRead = charCount < 512 ? (int)charCount : 512;char[] charsSkipped = new char[toRead];while (skipped < charCount){int read_1 = read(charsSkipped, 0, toRead);if (read_1 == -1){return skipped;}skipped += read_1;if (read_1 < toRead){return skipped;}if (charCount - skipped < toRead){toRead = (int)(charCount - skipped);}}return skipped;}}
Translate the following Java code to C#: public ValueEval getRef3DEval(Ref3DPxg rptg) {SheetRangeEvaluator sre = createExternSheetRefEvaluator(rptg.getSheetName(), rptg.getLastSheetName(), rptg.getExternalWorkbookNumber());return new LazyRefEval(rptg.getRow(), rptg.getColumn(), sre);}
public ValueEval GetRef3DEval(Ref3DPxg rptg){SheetRangeEvaluator sre = CreateExternSheetRefEvaluator(rptg.SheetName, rptg.LastSheetName, rptg.ExternalWorkbookNumber);return new LazyRefEval(rptg.Row, rptg.Column, sre);}
Translate the following Java code to C#: public NewAnalyzerTask(PerfRunData runData) {super(runData);analyzerNames = new ArrayList<>();}
public NewAnalyzerTask(PerfRunData runData): base(runData){analyzerNames = new List<string>();}
Translate the following Java code to C#: public boolean equals( Object o ) {return o instanceof EnglishStemmer;}
public override bool Equals(object o){return o is EnglishStemmer;}
Translate the following Java code to C#: public void decode(long[] blocks, int blocksOffset, long[] values,int valuesOffset, int iterations) {for (int i = 0; i < iterations; ++i) {final long block = blocks[blocksOffset++];valuesOffset = decode(block, values, valuesOffset);}}
public override void Decode(long[] blocks, int blocksOffset, long[] values, int valuesOffset, int iterations){for (int i = 0; i < iterations; ++i){long block = blocks[blocksOffset++];valuesOffset = Decode(block, values, valuesOffset);}}
Translate the following Java code to C#: public final void incRef() {ensureOpen();refCount.incrementAndGet();}
public void IncRef(){EnsureOpen();refCount.IncrementAndGet();}
Translate the following Java code to C#: public ReplicationGroup testFailover(TestFailoverRequest request) {request = beforeClientExecution(request);return executeTestFailover(request);}
public virtual TestFailoverResponse TestFailover(TestFailoverRequest request){var options = new InvokeOptions();options.RequestMarshaller = TestFailoverRequestMarshaller.Instance;options.ResponseUnmarshaller = TestFailoverResponseUnmarshaller.Instance;return Invoke<TestFailoverResponse>(request, options);}
Translate the following Java code to C#: public RefWriter(Collection<Ref> refs) {this.refs = RefComparator.sort(refs);}
public RefWriter(ICollection<Ref> refs){this.refs = RefComparator.Sort(refs);}
Translate the following Java code to C#: public ByteVector(int capacity) {if (capacity > 0) {blockSize = capacity;} else {blockSize = DEFAULT_BLOCK_SIZE;}array = new byte[blockSize];n = 0;}
public ByteVector(int capacity){if (capacity > 0){blockSize = capacity;}else{blockSize = DEFAULT_BLOCK_SIZE;}array = new byte[blockSize];n = 0;}
Translate the following Java code to C#: public void endWorker() {if (workers.decrementAndGet() == 0)process.release();}
public virtual void EndWorker(){if (workers.DecrementAndGet() == 0){process.Release();}}
Translate the following Java code to C#: public DescribeVolumeStatusResult describeVolumeStatus(DescribeVolumeStatusRequest request) {request = beforeClientExecution(request);return executeDescribeVolumeStatus(request);}
public virtual DescribeVolumeStatusResponse DescribeVolumeStatus(DescribeVolumeStatusRequest request){var options = new InvokeOptions();options.RequestMarshaller = DescribeVolumeStatusRequestMarshaller.Instance;options.ResponseUnmarshaller = DescribeVolumeStatusResponseUnmarshaller.Instance;return Invoke<DescribeVolumeStatusResponse>(request, options);}
Translate the following Java code to C#: public IntMapper(final int initialCapacity) {elements = new ArrayList<>(initialCapacity);valueKeyMap = new HashMap<>(initialCapacity);}
public IntMapper(int InitialCapacity){elements = new List<T>(InitialCapacity);valueKeyMap = new Dictionary<T, int>(InitialCapacity);}
Translate the following Java code to C#: public void serialize(LittleEndianOutput out) {out.writeShort(field_1_borderType);out.writeShort(field_2_options);}
public override void Serialize(ILittleEndianOutput out1){out1.WriteShort(field_1_borderType);out1.WriteShort(field_2_options);}
Translate the following Java code to C#: public synchronized void copyInto(Object[] elements) {System.arraycopy(elementData, 0, elements, 0, elementCount);}
public virtual void copyInto(object[] elements_1){lock (this){System.Array.Copy(elementData, 0, elements_1, 0, elementCount);}}
Translate the following Java code to C#: public ValueEval evaluate(int srcRowIndex, int srcColumnIndex, ValueEval arg0, ValueEval arg1) {double s0;String s1;try {s0 = evaluateDoubleArg(arg0, srcRowIndex, srcColumnIndex);s1 = evaluateStringArg(arg1, srcRowIndex, srcColumnIndex);} catch (EvaluationException e) {return e.getErrorEval();}try {String formattedStr = formatter.formatRawCellContents(s0, -1, s1);return new StringEval(formattedStr);} catch (Exception e) {return ErrorEval.VALUE_INVALID;}}
public override ValueEval Evaluate(int srcRowIndex, int srcColumnIndex, ValueEval arg0,ValueEval arg1){String arg;int index;try{arg = TextFunction.EvaluateStringArg(arg0, srcRowIndex, srcColumnIndex);index = TextFunction.EvaluateIntArg(arg1, srcRowIndex, srcColumnIndex);}catch (EvaluationException e){return e.GetErrorEval();}if (index < 0){return ErrorEval.VALUE_INVALID;}String result;if (_isLeft){result = arg.Substring(0, Math.Min(arg.Length, index));}else{result = arg.Substring(Math.Max(0, arg.Length - index));}return new StringEval(result);}
Translate the following Java code to C#: public CustomViewSettingsRecordAggregate(RecordStream rs) {_begin = rs.getNext();if (_begin.getSid() != UserSViewBegin.sid) {throw new IllegalStateException("Bad begin record");}List<RecordBase> temp = new ArrayList<>();while (rs.peekNextSid() != UserSViewEnd.sid) {if (PageSettingsBlock.isComponentRecord(rs.peekNextSid())) {if (_psBlock != null) {if (rs.peekNextSid() == HeaderFooterRecord.sid) {_psBlock.addLateHeaderFooter((HeaderFooterRecord)rs.getNext());continue;}throw new IllegalStateException("Found more than one PageSettingsBlock in chart sub-stream, had sid: " + rs.peekNextSid());}_psBlock = new PageSettingsBlock(rs);temp.add(_psBlock);continue;}temp.add(rs.getNext());}_recs = temp;_end = rs.getNext(); if (_end.getSid() != UserSViewEnd.sid) {throw new IllegalStateException("Bad custom view settings end record");}}
public CustomViewSettingsRecordAggregate(RecordStream rs){_begin = rs.GetNext();if (_begin.Sid != UserSViewBegin.sid){throw new InvalidOperationException("Bad begin record");}List<RecordBase> temp = new List<RecordBase>();while (rs.PeekNextSid() != UserSViewEnd.sid){if (PageSettingsBlock.IsComponentRecord(rs.PeekNextSid())){if (_psBlock != null){throw new InvalidOperationException("Found more than one PageSettingsBlock in custom view Settings sub-stream");}_psBlock = new PageSettingsBlock(rs);temp.Add(_psBlock);continue;}temp.Add(rs.GetNext());}_recs = temp;_end = rs.GetNext(); if (_end.Sid != UserSViewEnd.sid){throw new InvalidOperationException("Bad custom view Settings end record");}}
Translate the following Java code to C#: public DeleteSignalingChannelResult deleteSignalingChannel(DeleteSignalingChannelRequest request) {request = beforeClientExecution(request);return executeDeleteSignalingChannel(request);}
public virtual DeleteSignalingChannelResponse DeleteSignalingChannel(DeleteSignalingChannelRequest request){var options = new InvokeOptions();options.RequestMarshaller = DeleteSignalingChannelRequestMarshaller.Instance;options.ResponseUnmarshaller = DeleteSignalingChannelResponseUnmarshaller.Instance;return Invoke<DeleteSignalingChannelResponse>(request, options);}
Translate the following Java code to C#: @Override public boolean remove(Object o) {if (contains(o)) {Entry<?> entry = (Entry<?>) o;AtomicInteger frequency = backingMap.remove(entry.getElement());int numberRemoved = frequency.getAndSet(0);size -= numberRemoved;return true;}return false;}
public override bool remove(object o){if (!(o is java.util.MapClass.Entry<K, V>)){return false;}java.util.MapClass.Entry<object, object> e = (java.util.MapClass.Entry<object, object>)o;return this._enclosing.removeMapping(e.getKey(), e.getValue());}
Translate the following Java code to C#: public SnapshotDeletionPolicy(IndexDeletionPolicy primary) {this.primary = primary;}
public SnapshotDeletionPolicy(IndexDeletionPolicy primary){this.primary = primary;}
Translate the following Java code to C#: public void throwException() throws BufferUnderflowException,BufferOverflowException, UnmappableCharacterException,MalformedInputException, CharacterCodingException {switch (this.type) {case TYPE_UNDERFLOW:throw new BufferUnderflowException();case TYPE_OVERFLOW:throw new BufferOverflowException();case TYPE_UNMAPPABLE_CHAR:throw new UnmappableCharacterException(this.length);case TYPE_MALFORMED_INPUT:throw new MalformedInputException(this.length);default:throw new CharacterCodingException();}}
public virtual void throwException(){switch (this.type){case TYPE_UNDERFLOW:{throw new java.nio.BufferUnderflowException();}case TYPE_OVERFLOW:{throw new java.nio.BufferOverflowException();}case TYPE_UNMAPPABLE_CHAR:{throw new java.nio.charset.UnmappableCharacterException(this._length);}case TYPE_MALFORMED_INPUT:{throw new java.nio.charset.MalformedInputException(this._length);}default:{throw new java.nio.charset.CharacterCodingException();}}}
Translate the following Java code to C#: public StringPtg(LittleEndianInput in) {int nChars = in.readUByte(); _is16bitUnicode = (in.readByte() & 0x01) != 0;if (_is16bitUnicode) {field_3_string = StringUtil.readUnicodeLE(in, nChars);} else {field_3_string = StringUtil.readCompressedUnicode(in, nChars);}}
public StringPtg(ILittleEndianInput in1){int field_1_length = in1.ReadUByte();field_2_options = (byte)in1.ReadByte();_is16bitUnicode = (field_2_options & 0x01) != 0;if (_is16bitUnicode){field_3_string = StringUtil.ReadUnicodeLE(in1, field_1_length);}else{field_3_string = StringUtil.ReadCompressedUnicode(in1, field_1_length);}}
Translate the following Java code to C#: public GetPublicAccessUrlsRequest() {super("CloudPhoto", "2017-07-11", "GetPublicAccessUrls", "cloudphoto");setProtocol(ProtocolType.HTTPS);}
public GetPublicAccessUrlsRequest(): base("CloudPhoto", "2017-07-11", "GetPublicAccessUrls", "cloudphoto", "openAPI"){Protocol = ProtocolType.HTTPS;}
Translate the following Java code to C#: public CleanCommand clean() {return new CleanCommand(repo);}
public virtual CleanCommand Clean(){return new CleanCommand(repo);}
Translate the following Java code to C#: public Collection<PackFile> getPacks() {PackList list = packList.get();if (list == NO_PACKS)list = scanPacks(list);PackFile[] packs = list.packs;return Collections.unmodifiableCollection(Arrays.asList(packs));}
public virtual ICollection<PackFile> GetPacks(){ObjectDirectory.PackList list = packList.Get();if (list == NO_PACKS){list = ScanPacks(list);}PackFile[] packs = list.packs;return Sharpen.Collections.UnmodifiableCollection(Arrays.AsList(packs));}
Translate the following Java code to C#: public DescribeStackDriftDetectionStatusResult describeStackDriftDetectionStatus(DescribeStackDriftDetectionStatusRequest request) {request = beforeClientExecution(request);return executeDescribeStackDriftDetectionStatus(request);}
public virtual DescribeStackDriftDetectionStatusResponse DescribeStackDriftDetectionStatus(DescribeStackDriftDetectionStatusRequest request){var options = new InvokeOptions();options.RequestMarshaller = DescribeStackDriftDetectionStatusRequestMarshaller.Instance;options.ResponseUnmarshaller = DescribeStackDriftDetectionStatusResponseUnmarshaller.Instance;return Invoke<DescribeStackDriftDetectionStatusResponse>(request, options);}
Translate the following Java code to C#: public ListCloudFrontOriginAccessIdentitiesResult listCloudFrontOriginAccessIdentities(ListCloudFrontOriginAccessIdentitiesRequest request) {request = beforeClientExecution(request);return executeListCloudFrontOriginAccessIdentities(request);}
public virtual ListCloudFrontOriginAccessIdentitiesResponse ListCloudFrontOriginAccessIdentities(ListCloudFrontOriginAccessIdentitiesRequest request){var options = new InvokeOptions();options.RequestMarshaller = ListCloudFrontOriginAccessIdentitiesRequestMarshaller.Instance;options.ResponseUnmarshaller = ListCloudFrontOriginAccessIdentitiesResponseUnmarshaller.Instance;return Invoke<ListCloudFrontOriginAccessIdentitiesResponse>(request, options);}
Translate the following Java code to C#: public static SshSessionFactory getInstance() {return INSTANCE;}
public static SshSessionFactory GetInstance(){return INSTANCE;}
Translate the following Java code to C#: public ListConferenceProvidersResult listConferenceProviders(ListConferenceProvidersRequest request) {request = beforeClientExecution(request);return executeListConferenceProviders(request);}
public virtual ListConferenceProvidersResponse ListConferenceProviders(ListConferenceProvidersRequest request){var options = new InvokeOptions();options.RequestMarshaller = ListConferenceProvidersRequestMarshaller.Instance;options.ResponseUnmarshaller = ListConferenceProvidersResponseUnmarshaller.Instance;return Invoke<ListConferenceProvidersResponse>(request, options);}
Translate the following Java code to C#: public UpdateReceiptRuleResult updateReceiptRule(UpdateReceiptRuleRequest request) {request = beforeClientExecution(request);return executeUpdateReceiptRule(request);}
public virtual UpdateReceiptRuleResponse UpdateReceiptRule(UpdateReceiptRuleRequest request){var options = new InvokeOptions();options.RequestMarshaller = UpdateReceiptRuleRequestMarshaller.Instance;options.ResponseUnmarshaller = UpdateReceiptRuleResponseUnmarshaller.Instance;return Invoke<UpdateReceiptRuleResponse>(request, options);}
Translate the following Java code to C#: public String toString() {final StringBuilder r = new StringBuilder();r.append("("); for (int i = 0; i < subfilters.length; i++) {if (i > 0)r.append(" OR "); r.append(subfilters[i].toString());}r.append(")"); return r.toString();}
public override string ToString(){StringBuilder r = new StringBuilder();r.Append("(");for (int i = 0; i < subfilters.Length; i++){if (i > 0){r.Append(" OR ");}r.Append(subfilters[i].ToString());}r.Append(")");return r.ToString();}
Translate the following Java code to C#: public void serialize(LittleEndianOutput out) {out.writeShort(sid);out.writeShort(length);out.writeShort(flags);}
public override void Serialize(ILittleEndianOutput out1){out1.WriteShort(sid);out1.WriteShort(length);out1.WriteShort(flags);}
Translate the following Java code to C#: public UpdateHealthCheckResult updateHealthCheck(UpdateHealthCheckRequest request) {request = beforeClientExecution(request);return executeUpdateHealthCheck(request);}
public virtual UpdateHealthCheckResponse UpdateHealthCheck(UpdateHealthCheckRequest request){var options = new InvokeOptions();options.RequestMarshaller = UpdateHealthCheckRequestMarshaller.Instance;options.ResponseUnmarshaller = UpdateHealthCheckResponseUnmarshaller.Instance;return Invoke<UpdateHealthCheckResponse>(request, options);}
Translate the following Java code to C#: public synchronized long ramBytesUsed() {long bytes = 0;for(CachedOrds ords : ordsCache.values()) {bytes += ords.ramBytesUsed();}return bytes;}
public long RamBytesUsed(){long mem = RamUsageEstimator.ShallowSizeOf(this) + RamUsageEstimator.SizeOf(Offsets);if (Offsets != Ordinals){mem += RamUsageEstimator.SizeOf(Ordinals);}return mem;}
Translate the following Java code to C#: public UpdateWorkforceResult updateWorkforce(UpdateWorkforceRequest request) {request = beforeClientExecution(request);return executeUpdateWorkforce(request);}
public virtual UpdateWorkforceResponse UpdateWorkforce(UpdateWorkforceRequest request){var options = new InvokeOptions();options.RequestMarshaller = UpdateWorkforceRequestMarshaller.Instance;options.ResponseUnmarshaller = UpdateWorkforceResponseUnmarshaller.Instance;return Invoke<UpdateWorkforceResponse>(request, options);}
Translate the following Java code to C#: public void setObjectId(AnyObjectId id) {id.copyRawTo(idBuffer(), idOffset());}
public virtual void SetObjectId(AnyObjectId id){id.CopyRawTo(IdBuffer, IdOffset);}
Translate the following Java code to C#: public void write(byte[] buffer, int byteOffset, int byteCount) throws IOException {IoBridge.write(fd, buffer, byteOffset, byteCount);if (syncMetadata) {fd.sync();}}
public virtual void write(byte[] buffer, int byteOffset, int byteCount){throw new System.NotImplementedException();}
End of preview. Expand in Data Studio

No dataset card yet

Downloads last month
4