All Downloads are FREE. Search and download functionalities are using the official Maven repository.

CS2JNet.System.Text.EncodingSupport Maven / Gradle / Ivy

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