CS2JNet.System.Text.EncodingSupport Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of org.cs2j.dotnet.corlib Show documentation
Show all versions of org.cs2j.dotnet.corlib Show documentation
CS2J Support library (.NET corlib reimplementation)
The newest version!
package CS2JNet.System.Text;
import java.io.UnsupportedEncodingException;
import java.nio.charset.Charset;
public class EncodingSupport {
private String coding = "utf-8";
public EncodingSupport(String coding) {
this.coding = coding;
}
public byte[] getBytes(String input) throws UnsupportedEncodingException {
return input.getBytes(coding);
}
public String getString() {
return coding;
}
public Charset getCharset() {
return Charset.forName(coding);
}
public static EncodingSupport GetEncoder(String coding) {
return new EncodingSupport(coding);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy