Lines Matching refs:charset
18 import java.nio.charset.Charset;
37 private final String charset;
39 private MediaType(String mediaType, String type, String subtype, String charset) {
43 this.charset = charset;
56 String charset = null;
63 if (name == null || !name.equalsIgnoreCase("charset")) continue;
64 if (charset != null) throw new IllegalArgumentException("Multiple charsets: " + string);
65 charset = parameter.group(2) != null
70 return new MediaType(string, type, subtype, charset);
90 * Returns the charset of this media type, or null if this media type doesn't
91 * specify a charset.
93 public Charset charset() {
94 return charset != null ? Charset.forName(charset) : null;
98 * Returns the charset of this media type, or {@code defaultValue} if this
99 * media type doesn't specify a charset.
101 public Charset charset(Charset defaultValue) {
102 return charset != null ? Charset.forName(charset) : defaultValue;
106 * Returns the encoded media type, like "text/plain; charset=utf-8",