Commit 1962abb0 authored by Elliott Hughes's avatar Elliott Hughes Committed by Gerrit Code Review
Browse files

Merge "Retire the java.nio.charset.Charsets Charset constants."

parents b6e8336a 29377d58
...@@ -17,30 +17,11 @@ ...@@ -17,30 +17,11 @@
package java.nio.charset; package java.nio.charset;
/** /**
* Provides convenient access to the most important built-in charsets. Saves a hash lookup and * Various special-case charset conversions (for performance).
* unnecessary handling of UnsupportedEncodingException at call sites, compared to using the
* charset's name.
*
* Also various special-case charset conversions (for performance).
* *
* @hide internal use only * @hide internal use only
*/ */
public final class Charsets { public final class Charsets {
/**
* A cheap and type-safe constant for the ISO-8859-1 Charset.
*/
public static final Charset ISO_8859_1 = Charset.forName("ISO-8859-1");
/**
* A cheap and type-safe constant for the US-ASCII Charset.
*/
public static final Charset US_ASCII = Charset.forName("US-ASCII");
/**
* A cheap and type-safe constant for the UTF-8 Charset.
*/
public static final Charset UTF_8 = Charset.forName("UTF-8");
/** /**
* Returns a new byte array containing the bytes corresponding to the given characters, * Returns a new byte array containing the bytes corresponding to the given characters,
* encoded in US-ASCII. Unrepresentable characters are replaced by (byte) '?'. * encoded in US-ASCII. Unrepresentable characters are replaced by (byte) '?'.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment