mirror of
https://github.com/twiglet/cs2j.git
synced 2025-01-18 13:15:17 +01:00
support Encoding.GetString(...)
This commit is contained in:
parent
0ee989abd9
commit
becceb3eb3
@ -26,6 +26,26 @@
|
|||||||
<Name>GetBytes</Name>
|
<Name>GetBytes</Name>
|
||||||
<Return>System.Byte[]</Return>
|
<Return>System.Byte[]</Return>
|
||||||
</Method>
|
</Method>
|
||||||
|
<Method>
|
||||||
|
<Imports />
|
||||||
|
<Java>new String(${buf}, ${index}, ${count}, ${this:16}.getCharset())</Java>
|
||||||
|
<Params>
|
||||||
|
<Param>
|
||||||
|
<Type>System.Byte[]</Type>
|
||||||
|
<Name>buf</Name>
|
||||||
|
</Param>
|
||||||
|
<Param>
|
||||||
|
<Type>System.Int32</Type>
|
||||||
|
<Name>index</Name>
|
||||||
|
</Param>
|
||||||
|
<Param>
|
||||||
|
<Type>System.Int32</Type>
|
||||||
|
<Name>count</Name>
|
||||||
|
</Param>
|
||||||
|
</Params>
|
||||||
|
<Name>GetString</Name>
|
||||||
|
<Return>System.String</Return>
|
||||||
|
</Method>
|
||||||
</Methods>
|
</Methods>
|
||||||
<Properties>
|
<Properties>
|
||||||
<Property>
|
<Property>
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
package CS2JNet.System.Text;
|
package CS2JNet.System.Text;
|
||||||
|
|
||||||
import java.io.UnsupportedEncodingException;
|
import java.io.UnsupportedEncodingException;
|
||||||
|
import java.nio.charset.Charset;
|
||||||
|
|
||||||
public class EncodingSupport {
|
public class EncodingSupport {
|
||||||
|
|
||||||
@ -17,6 +18,10 @@ public class EncodingSupport {
|
|||||||
return coding;
|
return coding;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Charset getCharset() {
|
||||||
|
return Charset.forName(coding);
|
||||||
|
}
|
||||||
|
|
||||||
public static EncodingSupport GetEncoder(String coding) {
|
public static EncodingSupport GetEncoder(String coding) {
|
||||||
return new EncodingSupport(coding);
|
return new EncodingSupport(coding);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user