IT. Expert System.

Android Reference

Charsets


java.nio.charset

Class Charsets



  • public final class Charsets
    extends Object
    Provides convenient access to the most important built-in charsets. Saves a hash lookup and unnecessary handling of UnsupportedEncodingException at call sites, compared to using the charset's name. Also various special-case charset conversions (for performance).
    • Field Summary

      Fields
      Modifier and Type Field and Description
      static Charset ISO_8859_1
      A cheap and type-safe constant for the ISO-8859-1 Charset.
      static Charset US_ASCII
      A cheap and type-safe constant for the US-ASCII Charset.
      static Charset UTF_8
      A cheap and type-safe constant for the UTF-8 Charset.
    • Method Summary

      Methods
      Modifier and Type Method and Description
      static void asciiBytesToChars(byte[] bytes, int offset, int length, char[] chars)
      Decodes the given US-ASCII bytes into the given char[].
      static void isoLatin1BytesToChars(byte[] bytes, int offset, int length, char[] chars)
      Decodes the given ISO-8859-1 bytes into the given char[].
      static byte[] toAsciiBytes(char[] chars, int offset, int length)
      Returns a new byte array containing the bytes corresponding to the given characters, encoded in US-ASCII.
      static byte[] toBigEndianUtf16Bytes(char[] chars, int offset, int length)
      Returns a new byte array containing the bytes corresponding to the given characters, encoded in UTF-16BE.
      static byte[] toIsoLatin1Bytes(char[] chars, int offset, int length)
      Returns a new byte array containing the bytes corresponding to the given characters, encoded in ISO-8859-1.
      static byte[] toUtf8Bytes(char[] chars, int offset, int length)
      Returns a new byte array containing the bytes corresponding to the given characters, encoded in UTF-8.
    • Field Detail

      • ISO_8859_1

        public static final Charset ISO_8859_1
        A cheap and type-safe constant for the ISO-8859-1 Charset.
      • US_ASCII

        public static final Charset US_ASCII
        A cheap and type-safe constant for the US-ASCII Charset.
      • UTF_8

        public static final Charset UTF_8
        A cheap and type-safe constant for the UTF-8 Charset.
    • Method Detail

      • toAsciiBytes

        public static byte[] toAsciiBytes(char[] chars,
                          int offset,
                          int length)
        Returns a new byte array containing the bytes corresponding to the given characters, encoded in US-ASCII. Unrepresentable characters are replaced by (byte) '?'.
      • toIsoLatin1Bytes

        public static byte[] toIsoLatin1Bytes(char[] chars,
                              int offset,
                              int length)
        Returns a new byte array containing the bytes corresponding to the given characters, encoded in ISO-8859-1. Unrepresentable characters are replaced by (byte) '?'.
      • toUtf8Bytes

        public static byte[] toUtf8Bytes(char[] chars,
                         int offset,
                         int length)
        Returns a new byte array containing the bytes corresponding to the given characters, encoded in UTF-8. All characters are representable in UTF-8.
      • toBigEndianUtf16Bytes

        public static byte[] toBigEndianUtf16Bytes(char[] chars,
                                   int offset,
                                   int length)
        Returns a new byte array containing the bytes corresponding to the given characters, encoded in UTF-16BE. All characters are representable in UTF-16BE.
      • asciiBytesToChars

        public static void asciiBytesToChars(byte[] bytes,
                             int offset,
                             int length,
                             char[] chars)
        Decodes the given US-ASCII bytes into the given char[]. Equivalent to but faster than: for (int i = 0; i < count; ++i) { char ch = (char) (data[start++] & 0xff); value[i] = (ch <= 0x7f) ? ch : replacement_char; }
      • isoLatin1BytesToChars

        public static void isoLatin1BytesToChars(byte[] bytes,
                                 int offset,
                                 int length,
                                 char[] chars)
        Decodes the given ISO-8859-1 bytes into the given char[]. Equivalent to but faster than: for (int i = 0; i < count; ++i) { value[i] = (char) (data[start++] & 0xff); }


Content

Android Reference

Java basics

Java Enterprise Edition (EE)

Java Standard Edition (SE)

SQL

HTML

PHP

CSS

Java Script

MYSQL

JQUERY

VBS

REGEX

C

C++

C#

Design patterns

RFC (standard status)

RFC (proposed standard status)

RFC (draft standard status)

RFC (informational status)

RFC (experimental status)

RFC (best current practice status)

RFC (historic status)

RFC (unknown status)

IT dictionary

License.
All information of this service is derived from the free sources and is provided solely in the form of quotations. This service provides information and interfaces solely for the familiarization (not ownership) and under the "as is" condition.
Copyright 2016 © ELTASK.COM. All rights reserved.
Site is optimized for mobile devices.
Downloads: 715 / . Delta: 0.01764 с