Lines Matching defs:charset
54 * the specified charset is not supported, default system encoding
60 * @param charset the desired character encoding
67 String charset
74 if (charset == null || charset.length() == 0) {
75 throw new IllegalArgumentException("charset may not be null or empty");
79 return new String(data, offset, length, charset);
88 * the specified charset is not supported, default system encoding
92 * @param charset the desired character encoding
95 public static String getString(final byte[] data, final String charset) {
99 return getString(data, 0, data.length, charset);
103 * Converts the specified string to a byte array. If the charset is not supported the
104 * default system charset is used.
107 * @param charset the desired character encoding
110 public static byte[] getBytes(final String data, final String charset) {
116 if (charset == null || charset.length() == 0) {
117 throw new IllegalArgumentException("charset may not be null or empty");
121 return data.getBytes(charset);