264 * between sequences of sixteen-bit UTF-16 code units (that is, sequences
265 * of chars) and sequences of bytes. </p>
266 *
267 *
268 * @author Mark Reinhold
269 * @author JSR-51 Expert Group
270 * @since 1.4
271 *
272 * @see CharsetDecoder
273 * @see CharsetEncoder
274 * @see java.nio.charset.spi.CharsetProvider
275 * @see java.lang.Character
276 */
277
278 public abstract class Charset
279 implements Comparable<Charset>
280 {
281
282 /* -- Static methods -- */
283
284 private static volatile String bugLevel;
285
286 static boolean atBugLevel(String bl) { // package-private
287 String level = bugLevel;
288 if (level == null) {
289 if (!VM.isBooted())
290 return false;
291 bugLevel = level = GetPropertyAction
292 .privilegedGetProperty("sun.nio.cs.bugLevel", "");
293 }
294 return level.equals(bl);
295 }
296
297 /**
298 * Checks that the given string is a legal charset name. </p>
299 *
300 * @param s
301 * A purported charset name
302 *
303 * @throws IllegalCharsetNameException
304 * If the given name is not a legal charset name
|
264 * between sequences of sixteen-bit UTF-16 code units (that is, sequences
265 * of chars) and sequences of bytes. </p>
266 *
267 *
268 * @author Mark Reinhold
269 * @author JSR-51 Expert Group
270 * @since 1.4
271 *
272 * @see CharsetDecoder
273 * @see CharsetEncoder
274 * @see java.nio.charset.spi.CharsetProvider
275 * @see java.lang.Character
276 */
277
278 public abstract class Charset
279 implements Comparable<Charset>
280 {
281
282 /* -- Static methods -- */
283
284 private static String bugLevel;
285
286 static boolean atBugLevel(String bl) { // package-private
287 String level = bugLevel;
288 if (level == null) {
289 if (!VM.isBooted())
290 return false;
291 bugLevel = level = GetPropertyAction
292 .privilegedGetProperty("sun.nio.cs.bugLevel", "");
293 }
294 return level.equals(bl);
295 }
296
297 /**
298 * Checks that the given string is a legal charset name. </p>
299 *
300 * @param s
301 * A purported charset name
302 *
303 * @throws IllegalCharsetNameException
304 * If the given name is not a legal charset name
|