yijunyu/c-to-rust huggingface dataset:
// Original:
public GetModelVersionResult getModelVersion(GetModelVersionRequest request) {request = beforeClientExecution(request);return executeGetModelVersion(request);}

// Translation:
public virtual GetModelVersionResponse GetModelVersion(GetModelVersionRequest request){var options = new InvokeOptions();options.RequestMarshaller = GetModelVersionRequestMarshaller.Instance;options.ResponseUnmarshaller = GetModelVersionResponseUnmarshaller.Instance;return Invoke<GetModelVersionResponse>(request, options);}
// Original:
public void addBreak(int main, int subFrom, int subTo) {Integer key = Integer.valueOf(main);Break region = _breakMap.get(key);if(region == null) {region = new Break(main, subFrom, subTo);_breakMap.put(key, region);_breaks.add(region);} else {region.main = main;region.subFrom = subFrom;region.subTo = subTo;}}

// Translation:
public void AddBreak(int main, int subFrom, int subTo){int key = (int)main;Break region = (Break)_breakMap[key];if (region != null){region.main = main;region.subFrom = subFrom;region.subTo = subTo;}else{region = new Break(main, subFrom, subTo);_breaks.Add(region);}_breakMap[key] = region;}
// Original:
public DescribeUsageReportSubscriptionsResult describeUsageReportSubscriptions(DescribeUsageReportSubscriptionsRequest request) {request = beforeClientExecution(request);return executeDescribeUsageReportSubscriptions(request);}

// Translation:
public virtual DescribeUsageReportSubscriptionsResponse DescribeUsageReportSubscriptions(DescribeUsageReportSubscriptionsRequest request){var options = new InvokeOptions();options.RequestMarshaller = DescribeUsageReportSubscriptionsRequestMarshaller.Instance;options.ResponseUnmarshaller = DescribeUsageReportSubscriptionsResponseUnmarshaller.Instance;return Invoke<DescribeUsageReportSubscriptionsResponse>(request, options);}
// Original:
public boolean offerLast(E e) {return addLastImpl(e);}

// Translation:
public virtual bool offerLast(E e){return addLastImpl(e);}
// Original:
public RegistrantProfileRealNameVerificationRequest() {super("Domain", "2018-01-29", "RegistrantProfileRealNameVerification");setMethod(MethodType.POST);}

// Translation:
public RegistrantProfileRealNameVerificationRequest(): base("Domain-intl", "2017-12-18", "RegistrantProfileRealNameVerification", "domain", "openAPI"){Method = MethodType.POST;}
// Original:
public RowColKey(int rowIndex, int columnIndex) {_rowIndex = rowIndex;_columnIndex = columnIndex;}

// Translation:
public RowColKey(int rowIndex, int columnIndex){_rowIndex = rowIndex;_columnIndex = columnIndex;}
// Original:
public DisassociateTransitGatewayMulticastDomainResult disassociateTransitGatewayMulticastDomain(DisassociateTransitGatewayMulticastDomainRequest request) {request = beforeClientExecution(request);return executeDisassociateTransitGatewayMulticastDomain(request);}

// Translation:
public virtual DisassociateTransitGatewayMulticastDomainResponse DisassociateTransitGatewayMulticastDomain(DisassociateTransitGatewayMulticastDomainRequest request){var options = new InvokeOptions();options.RequestMarshaller = DisassociateTransitGatewayMulticastDomainRequestMarshaller.Instance;options.ResponseUnmarshaller = DisassociateTransitGatewayMulticastDomainResponseUnmarshaller.Instance;return Invoke<DisassociateTransitGatewayMulticastDomainResponse>(request, options);}
// Original:
public Charset detectedCharset() {throw new UnsupportedOperationException();}

// Translation:
public virtual java.nio.charset.Charset detectedCharset(){throw new System.NotSupportedException();}
// Original:
public RightMarginRecord clone() {return copy();}

// Translation:
public override Object Clone(){RightMarginRecord rec = new RightMarginRecord();rec.field_1_margin = this.field_1_margin;return rec;}
// Original:
public ListTrafficPoliciesResult listTrafficPolicies(ListTrafficPoliciesRequest request) {request = beforeClientExecution(request);return executeListTrafficPolicies(request);}

// Translation:
public virtual ListTrafficPoliciesResponse ListTrafficPolicies(ListTrafficPoliciesRequest request){var options = new InvokeOptions();options.RequestMarshaller = ListTrafficPoliciesRequestMarshaller.Instance;options.ResponseUnmarshaller = ListTrafficPoliciesResponseUnmarshaller.Instance;return Invoke<ListTrafficPoliciesResponse>(request, options);}
// Original:
public DeleteKeyPairRequest(String keyName) {setKeyName(keyName);}

// Translation:
public DeleteKeyPairRequest(string keyName){_keyName = keyName;}
// Original:
public void setElement(int index, byte[] element) {if (emptyComplexPart) {return;}int actualSize = getActualSizeOfElements(getSizeOfElements());System.arraycopy( element, 0, getComplexData(), FIXED_SIZE + index * actualSize, actualSize);}

// Translation:
public void SetElement(int index, byte[] element){int actualSize = GetActualSizeOfElements(SizeOfElements);Array.Copy(element, 0, _complexData, FIXED_SIZE + index * actualSize, actualSize);}
// Original:
public FieldDoc(int doc, float score, Object[] fields) {super(doc, score);this.fields = fields;}

// Translation:
public FieldDoc(int doc, float score, object[] fields): base(doc, score){this.fields = fields;}
// Original:
public TreeFilter clone() {return new Binary(a.clone(), b.clone());}

// Translation:
public override RevFilter Clone(){return new OrRevFilter.Binary(a.Clone(), b.Clone());}
// Original:
public void fillTo(int toIndex, long val) {while (count < toIndex)add(val);}

// Translation:
public virtual void FillTo(int toIndex, long val){while (count < toIndex){Add(val);}}
// Original:
public void decode(byte[] blocks, int blocksOffset, long[] values, int valuesOffset, int iterations) {for (int i = 0; i < iterations; ++i) {final long byte0 = blocks[blocksOffset++] & 0xFF;values[valuesOffset++] = byte0 >>> 5;values[valuesOffset++] = (byte0 >>> 2) & 7;final long byte1 = blocks[blocksOffset++] & 0xFF;values[valuesOffset++] = ((byte0 & 3) << 1) | (byte1 >>> 7);values[valuesOffset++] = (byte1 >>> 4) & 7;values[valuesOffset++] = (byte1 >>> 1) & 7;final long byte2 = blocks[blocksOffset++] & 0xFF;values[valuesOffset++] = ((byte1 & 1) << 2) | (byte2 >>> 6);values[valuesOffset++] = (byte2 >>> 3) & 7;values[valuesOffset++] = byte2 & 7;}}

// Translation:
public override void Decode(byte[] blocks, int blocksOffset, long[] values, int valuesOffset, int iterations){for (int i = 0; i < iterations; ++i){long byte0 = blocks[blocksOffset++] & 0xFF;values[valuesOffset++] = (long)((ulong)byte0 >> 5);values[valuesOffset++] = ((long)((ulong)byte0 >> 2)) & 7;long byte1 = blocks[blocksOffset++] & 0xFF;values[valuesOffset++] = ((byte0 & 3) << 1) | ((long)((ulong)byte1 >> 7));values[valuesOffset++] = ((long)((ulong)byte1 >> 4)) & 7;values[valuesOffset++] = ((long)((ulong)byte1 >> 1)) & 7;long byte2 = blocks[blocksOffset++] & 0xFF;values[valuesOffset++] = ((byte1 & 1) << 2) | ((long)((ulong)byte2 >> 6));values[valuesOffset++] = ((long)((ulong)byte2 >> 3)) & 7;values[valuesOffset++] = byte2 & 7;}}
// Original:
public RawText getResultContents() {return resultContents;}

// Translation:
public virtual RawText GetResultContents(){return resultContents;}
// Original:
public void setMaxShingleSize(int maxShingleSize) {if (maxShingleSize < 2) {throw new IllegalArgumentException("Max shingle size must be >= 2");}this.maxShingleSize = maxShingleSize;}

// Translation:
public void SetMaxShingleSize(int maxShingleSize){if (maxShingleSize < 2){throw new System.ArgumentException("Max shingle size must be >= 2");}this.maxShingleSize = maxShingleSize;}
// Original:
public FieldInfo(RecordInputStream in) {_isxvi = in.readShort();_isxvd = in.readShort();_idObj = in.readShort();}

// Translation:
public FieldInfo(RecordInputStream in1){_isxvi = in1.ReadShort();_isxvd = in1.ReadShort();_idObj = in1.ReadShort();}
// Original:
public DescribeDBEngineVersionsResult describeDBEngineVersions(DescribeDBEngineVersionsRequest request) {request = beforeClientExecution(request);return executeDescribeDBEngineVersions(request);}

// Translation:
public virtual DescribeDBEngineVersionsResponse DescribeDBEngineVersions(DescribeDBEngineVersionsRequest request){var options = new InvokeOptions();options.RequestMarshaller = DescribeDBEngineVersionsRequestMarshaller.Instance;options.ResponseUnmarshaller = DescribeDBEngineVersionsResponseUnmarshaller.Instance;return Invoke<DescribeDBEngineVersionsResponse>(request, options);}
// Original:
public DBSnapshot copyDBSnapshot(CopyDBSnapshotRequest request) {request = beforeClientExecution(request);return executeCopyDBSnapshot(request);}

// Translation:
public virtual CopyDBSnapshotResponse CopyDBSnapshot(CopyDBSnapshotRequest request){var options = new InvokeOptions();options.RequestMarshaller = CopyDBSnapshotRequestMarshaller.Instance;options.ResponseUnmarshaller = CopyDBSnapshotResponseUnmarshaller.Instance;return Invoke<CopyDBSnapshotResponse>(request, options);}
// Original:
public DFA(DecisionState atnStartState, int decision) {this.atnStartState = atnStartState;this.decision = decision;boolean precedenceDfa = false;if (atnStartState instanceof StarLoopEntryState) {if (((StarLoopEntryState)atnStartState).isPrecedenceDecision) {precedenceDfa = true;DFAState precedenceState = new DFAState(new ATNConfigSet());precedenceState.edges = new DFAState[0];precedenceState.isAcceptState = false;precedenceState.requiresFullContext = false;this.s0 = precedenceState;}}this.precedenceDfa = precedenceDfa;}

// Translation:
public DFA(DecisionState atnStartState, int decision){this.atnStartState = atnStartState;this.decision = decision;this.precedenceDfa = false;if (atnStartState is StarLoopEntryState && ((StarLoopEntryState)atnStartState).isPrecedenceDecision){this.precedenceDfa = true;DFAState precedenceState = new DFAState(new ATNConfigSet());precedenceState.edges = new DFAState[0];precedenceState.isAcceptState = false;precedenceState.requiresFullContext = false;this.s0 = precedenceState;}}
// Original:
public QueryParserTokenManager(CharStream stream){input_stream = stream;}

// Translation:
public QueryParserTokenManager(ICharStream stream){m_input_stream = stream;}
// Original:
public String toString() {return "<group>" + "\n" + getChild().toString() + "\n</group>";}

// Translation:
public override string ToString(){return "<group>" + "\n" + GetChild().ToString() + "\n</group>";}
// Original:
public UpdateResolverRuleResult updateResolverRule(UpdateResolverRuleRequest request) {request = beforeClientExecution(request);return executeUpdateResolverRule(request);}

// Translation:
public virtual UpdateResolverRuleResponse UpdateResolverRule(UpdateResolverRuleRequest request){var options = new InvokeOptions();options.RequestMarshaller = UpdateResolverRuleRequestMarshaller.Instance;options.ResponseUnmarshaller = UpdateResolverRuleResponseUnmarshaller.Instance;return Invoke<UpdateResolverRuleResponse>(request, options);}
// Original:
public int compareTo(BytesRef other) {return Arrays.compareUnsigned(this.bytes, this.offset, this.offset + this.length,other.bytes, other.offset, other.offset + other.length);}

// Translation:
public int CompareTo(BytesRef other){return utf8SortedAsUnicodeSortOrder.Compare(this, other);}
// Original:
public void rewind() {ns.removeAllElements();ks.setLength(0);cur = root;run();}

// Translation:
public virtual void Rewind(){ns.Clear();ks.Length = 0;cur = outerInstance.m_root;Run();}
// Original:
public ModifyWorkspaceAccessPropertiesResult modifyWorkspaceAccessProperties(ModifyWorkspaceAccessPropertiesRequest request) {request = beforeClientExecution(request);return executeModifyWorkspaceAccessProperties(request);}

// Translation:
public virtual ModifyWorkspaceAccessPropertiesResponse ModifyWorkspaceAccessProperties(ModifyWorkspaceAccessPropertiesRequest request){var options = new InvokeOptions();options.RequestMarshaller = ModifyWorkspaceAccessPropertiesRequestMarshaller.Instance;options.ResponseUnmarshaller = ModifyWorkspaceAccessPropertiesResponseUnmarshaller.Instance;return Invoke<ModifyWorkspaceAccessPropertiesResponse>(request, options);}
// Original:
public DescribeFleetAttributesResult describeFleetAttributes(DescribeFleetAttributesRequest request) {request = beforeClientExecution(request);return executeDescribeFleetAttributes(request);}

// Translation:
public virtual DescribeFleetAttributesResponse DescribeFleetAttributes(DescribeFleetAttributesRequest request){var options = new InvokeOptions();options.RequestMarshaller = DescribeFleetAttributesRequestMarshaller.Instance;options.ResponseUnmarshaller = DescribeFleetAttributesResponseUnmarshaller.Instance;return Invoke<DescribeFleetAttributesResponse>(request, options);}
// Original:
public CreateBuildResult createBuild(CreateBuildRequest request) {request = beforeClientExecution(request);return executeCreateBuild(request);}

// Translation:
public virtual CreateBuildResponse CreateBuild(CreateBuildRequest request){var options = new InvokeOptions();options.RequestMarshaller = CreateBuildRequestMarshaller.Instance;options.ResponseUnmarshaller = CreateBuildResponseUnmarshaller.Instance;return Invoke<CreateBuildResponse>(request, options);}
// Original:
public static FloatBuffer wrap(float[] array, int start, int floatCount) {Arrays.checkOffsetAndCount(array.length, start, floatCount);FloatBuffer buf = new ReadWriteFloatArrayBuffer(array);buf.position = start;buf.limit = start + floatCount;return buf;}

// Translation:
public static java.nio.FloatBuffer wrap(float[] array_1, int start, int floatCount){java.util.Arrays.checkOffsetAndCount(array_1.Length, start, floatCount);java.nio.FloatBuffer buf = new java.nio.ReadWriteFloatArrayBuffer(array_1);buf._position = start;buf._limit = start + floatCount;return buf;}
// Original:
public String toString() {StringBuilder result = new StringBuilder();DateFormatTokenizer tokenizer = new DateFormatTokenizer(format);String token;while( ( token = tokenizer.getNextToken() ) != null ) {if( result.length() > 0 ) {result.append( ", " );}result.append("[").append(token).append("]");}return result.toString();}

// Translation:
public override string ToString(){StringBuilder result = new StringBuilder();DateFormatTokenizer tokenizer = new DateFormatTokenizer(format);string token;while ((token = tokenizer.GetNextToken()) != null){if (result.Length > 0){result.Append(", ");}result.Append("[").Append(token).Append("]");}return result.ToString();}
// Original:
public byte readByte() {return data[pos++];}

// Translation:
public override byte ReadByte(){return data[pos++];}
// Original:
public CreateDatasetResult createDataset(CreateDatasetRequest request) {request = beforeClientExecution(request);return executeCreateDataset(request);}

// Translation:
public virtual CreateDatasetResponse CreateDataset(CreateDatasetRequest request){var options = new InvokeOptions();options.RequestMarshaller = CreateDatasetRequestMarshaller.Instance;options.ResponseUnmarshaller = CreateDatasetResponseUnmarshaller.Instance;return Invoke<CreateDatasetResponse>(request, options);}
// Original:
public BytesRef next() {termOrd++;if (termOrd < terms.length) {return setTerm();} else {return null;}}

// Translation:
public override BytesRef Next(){termOrd++;if (termOrd < outerInstance.terms.Length){return SetTerm();}else{return null;}}
// Original:
public static FontCharset valueOf(int value){return (value < 0 || value >= _table.length) ? null :_table[value];}

// Translation:
public static FontCharset ValueOf(int value){if(value>=0&&value<=255)return _table[value];return null;}
// Original:
public static String escape(String s) {StringBuilder sb = new StringBuilder();for (int i = 0; i < s.length(); i++) {char c = s.charAt(i);if (c == '\\' || c == '+' || c == '-' || c == '!' || c == '(' || c == ')'|| c == ':' || c == '^' || c == '[' || c == ']' || c == '\"'|| c == '{' || c == '}' || c == '~' || c == '*' || c == '?'|| c == '|' || c == '&' || c == '/') {sb.append('\\');}sb.append(c);}return sb.toString();}

// Translation:
public static string Escape(string s){StringBuilder sb = new StringBuilder();for (int i = 0; i < s.Length; i++){char c = s[i];if (c == '\\' || c == '+' || c == '-' || c == '!' || c == '(' || c == ')'|| c == ':' || c == '^' || c == '[' || c == ']' || c == '\"'|| c == '{' || c == '}' || c == '~' || c == '*' || c == '?'|| c == '|' || c == '&' || c == '/'){sb.Append('\\');}sb.Append(c);}return sb.ToString();}
// Original:
public RejectVpcEndpointConnectionsResult rejectVpcEndpointConnections(RejectVpcEndpointConnectionsRequest request) {request = beforeClientExecution(request);return executeRejectVpcEndpointConnections(request);}

// Translation:
public virtual RejectVpcEndpointConnectionsResponse RejectVpcEndpointConnections(RejectVpcEndpointConnectionsRequest request){var options = new InvokeOptions();options.RequestMarshaller = RejectVpcEndpointConnectionsRequestMarshaller.Instance;options.ResponseUnmarshaller = RejectVpcEndpointConnectionsResponseUnmarshaller.Instance;return Invoke<RejectVpcEndpointConnectionsResponse>(request, options);}
// Original:
public V next() { return nextEntry().value; }

// Translation:
public override V next(){return this.nextEntry().value;}
// Original:
public ShingleAnalyzerWrapper(Analyzer delegate,int minShingleSize,int maxShingleSize,String tokenSeparator,boolean outputUnigrams,boolean outputUnigramsIfNoShingles,String fillerToken) {super(delegate.getReuseStrategy());this.delegate = delegate;if (maxShingleSize < 2) {throw new IllegalArgumentException("Max shingle size must be >= 2");}this.maxShingleSize = maxShingleSize;if (minShingleSize < 2) {throw new IllegalArgumentException("Min shingle size must be >= 2");}if (minShingleSize > maxShingleSize) {throw new IllegalArgumentException("Min shingle size must be <= max shingle size");}this.minShingleSize = minShingleSize;this.tokenSeparator = (tokenSeparator == null ? "" : tokenSeparator);this.outputUnigrams = outputUnigrams;this.outputUnigramsIfNoShingles = outputUnigramsIfNoShingles;this.fillerToken = fillerToken;}

// Translation:
public ShingleAnalyzerWrapper(Analyzer @delegate, int minShingleSize, int maxShingleSize,string tokenSeparator, bool outputUnigrams, bool outputUnigramsIfNoShingles, string fillerToken): base(@delegate.Strategy){this.@delegate = @delegate;if (maxShingleSize < 2){throw new ArgumentOutOfRangeException("Max shingle size must be >= 2");}this.maxShingleSize = maxShingleSize;if (minShingleSize < 2){throw new ArgumentOutOfRangeException("Min shingle size must be >= 2");}if (minShingleSize > maxShingleSize){throw new ArgumentOutOfRangeException("Min shingle size must be <= max shingle size");}this.minShingleSize = minShingleSize;this.tokenSeparator = (tokenSeparator == null ? "" : tokenSeparator);this.outputUnigrams = outputUnigrams;this.outputUnigramsIfNoShingles = outputUnigramsIfNoShingles;this.fillerToken = fillerToken;}
// Original:
public CreateInterconnectResult createInterconnect(CreateInterconnectRequest request) {request = beforeClientExecution(request);return executeCreateInterconnect(request);}

// Translation:
public virtual CreateInterconnectResponse CreateInterconnect(CreateInterconnectRequest request){var options = new InvokeOptions();options.RequestMarshaller = CreateInterconnectRequestMarshaller.Instance;options.ResponseUnmarshaller = CreateInterconnectResponseUnmarshaller.Instance;return Invoke<CreateInterconnectResponse>(request, options);}
// Original:
public DeleteTrafficMirrorTargetResult deleteTrafficMirrorTarget(DeleteTrafficMirrorTargetRequest request) {request = beforeClientExecution(request);return executeDeleteTrafficMirrorTarget(request);}

// Translation:
public virtual DeleteTrafficMirrorTargetResponse DeleteTrafficMirrorTarget(DeleteTrafficMirrorTargetRequest request){var options = new InvokeOptions();options.RequestMarshaller = DeleteTrafficMirrorTargetRequestMarshaller.Instance;options.ResponseUnmarshaller = DeleteTrafficMirrorTargetResponseUnmarshaller.Instance;return Invoke<DeleteTrafficMirrorTargetResponse>(request, options);}
// Original:
public UpdateMonitoringScheduleResult updateMonitoringSchedule(UpdateMonitoringScheduleRequest request) {request = beforeClientExecution(request);return executeUpdateMonitoringSchedule(request);}

// Translation:
public virtual UpdateMonitoringScheduleResponse UpdateMonitoringSchedule(UpdateMonitoringScheduleRequest request){var options = new InvokeOptions();options.RequestMarshaller = UpdateMonitoringScheduleRequestMarshaller.Instance;options.ResponseUnmarshaller = UpdateMonitoringScheduleResponseUnmarshaller.Instance;return Invoke<UpdateMonitoringScheduleResponse>(request, options);}
// Original:
public DeleteGatewayGroupResult deleteGatewayGroup(DeleteGatewayGroupRequest request) {request = beforeClientExecution(request);return executeDeleteGatewayGroup(request);}

// Translation:
public virtual DeleteGatewayGroupResponse DeleteGatewayGroup(DeleteGatewayGroupRequest request){var options = new InvokeOptions();options.RequestMarshaller = DeleteGatewayGroupRequestMarshaller.Instance;options.ResponseUnmarshaller = DeleteGatewayGroupResponseUnmarshaller.Instance;return Invoke<DeleteGatewayGroupResponse>(request, options);}
// Original:
public ListStackSetOperationsResult listStackSetOperations(ListStackSetOperationsRequest request) {request = beforeClientExecution(request);return executeListStackSetOperations(request);}

// Translation:
public virtual ListStackSetOperationsResponse ListStackSetOperations(ListStackSetOperationsRequest request){var options = new InvokeOptions();options.RequestMarshaller = ListStackSetOperationsRequestMarshaller.Instance;options.ResponseUnmarshaller = ListStackSetOperationsResponseUnmarshaller.Instance;return Invoke<ListStackSetOperationsResponse>(request, options);}
// Original:
public ListOfOutputs(Outputs<T> outputs) {this.outputs = outputs;}

// Translation:
public ListOfOutputs(Outputs<T> outputs){this.outputs = outputs;}
// Original:
public ExceedsLimit(long limit, long size) {this.limit = limit;this.size = size;}

// Translation:
public ExceedsLimit(long limit, long size){this.limit = limit;this.size = size;}
// Original:
public GetIndustryInfoRequest() {super("industry-brain", "2018-07-12", "GetIndustryInfo");setProtocol(ProtocolType.HTTPS);}

// Translation:
public GetIndustryInfoRequest(): base("industry-brain", "2018-07-12", "GetIndustryInfo"){Protocol = ProtocolType.HTTPS;}
// Original:
public CreateVpnGatewayRequest(String type) {setType(type);}

// Translation:
public CreateVpnGatewayRequest(GatewayType type){_type = type;}
// Original:
public int compareTo(PointTransitions other) {return point - other.point;}

// Translation:
public int CompareTo(PointTransitions other){return point - other.point;}
// Original:
public DeleteQueuedReservedInstancesResult deleteQueuedReservedInstances(DeleteQueuedReservedInstancesRequest request) {request = beforeClientExecution(request);return executeDeleteQueuedReservedInstances(request);}

// Translation:
public virtual DeleteQueuedReservedInstancesResponse DeleteQueuedReservedInstances(DeleteQueuedReservedInstancesRequest request){var options = new InvokeOptions();options.RequestMarshaller = DeleteQueuedReservedInstancesRequestMarshaller.Instance;options.ResponseUnmarshaller = DeleteQueuedReservedInstancesResponseUnmarshaller.Instance;return Invoke<DeleteQueuedReservedInstancesResponse>(request, options);}
// Original:
public static final AbbreviatedObjectId fromString(String str) {if (str.length() > Constants.OBJECT_ID_STRING_LENGTH)throw new IllegalArgumentException(MessageFormat.format(JGitText.get().invalidId, str));final byte[] b = Constants.encodeASCII(str);return fromHexString(b, 0, b.length);}

// Translation:
public static NGit.AbbreviatedObjectId FromString(string str){if (str.Length > Constants.OBJECT_ID_STRING_LENGTH){throw new ArgumentException(MessageFormat.Format(JGitText.Get().invalidId, str));}byte[] b = Constants.EncodeASCII(str);return FromHexString(b, 0, b.Length);}