MCPcopy Index your code
hub / github.com/davidgiven/luje / getCharset

Method getCharset

lib/java/lang/String.java:883–899  ·  view source on GitHub ↗
(final String encoding)

Source from the content-addressed store, hash-verified

881 }
882
883 private Charset getCharset(final String encoding)
884 throws UnsupportedEncodingException {
885 Charset charset = lastCharset;
886 if (charset == null || !encoding.equalsIgnoreCase(charset.name())) {
887 try {
888 charset = Charset.forName(encoding);
889 } catch (IllegalCharsetNameException e) {
890 throw (UnsupportedEncodingException) (new UnsupportedEncodingException(
891 encoding).initCause(e));
892 } catch (UnsupportedCharsetException e) {
893 throw (UnsupportedEncodingException) (new UnsupportedEncodingException(
894 encoding).initCause(e));
895 }
896 lastCharset = charset;
897 }
898 return charset;
899 }
900
901 /**
902 * Copies the specified characters in this string to the character array

Callers 2

StringMethod · 0.95
getBytesMethod · 0.95

Calls 4

nameMethod · 0.95
forNameMethod · 0.95
equalsIgnoreCaseMethod · 0.80
initCauseMethod · 0.80

Tested by

no test coverage detected