1
0
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:
Kevin Glynn 2011-08-15 19:24:06 +02:00
parent 0ee989abd9
commit becceb3eb3
2 changed files with 25 additions and 0 deletions

View File

@ -26,6 +26,26 @@
<Name>GetBytes</Name>
<Return>System.Byte[]</Return>
</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>
<Properties>
<Property>

View File

@ -1,6 +1,7 @@
package CS2JNet.System.Text;
import java.io.UnsupportedEncodingException;
import java.nio.charset.Charset;
public class EncodingSupport {
@ -17,6 +18,10 @@ public class EncodingSupport {
return coding;
}
public Charset getCharset() {
return Charset.forName(coding);
}
public static EncodingSupport GetEncoder(String coding) {
return new EncodingSupport(coding);
}