| Modifier and Type | Field and Description |
|---|---|
| private static final Encoding | |
| private final Charset | |
| private static final HashMap | |
| private final boolean | |
| pack-priv static final AsciiStringInterner | |
| private static final Logger | |
| private static final Encoding |
| Access | Constructor and Description |
|---|---|
| private | |
| protected | |
| protected |
| Modifier and Type | Method and Description |
|---|---|
| public static void | canonicalize(String
The string to maintain canonicalized reference to. Must not be string)null.Indicates that string should be staged as a canonicalized value. |
| public String | Returns: the decoded stringa byte array containing the string to decode encodedString, int the offset in offset, int encodedString of the first byte of the encoded
representationthe length, in bytes, of the encoded representation length)Decode an array of bytes into a string. |
| public String | Returns: the decoded stringa byte array containing the string to decode encodedString)Decode an array of bytes into a string. |
| public String | Returns: the decoded stringa byte array containing the string to decode encodedString, int the offset in offset, int encodedString of the first byte of the encoded
representationthe length, in bytes, of the encoded representation length)Decode an array of bytes possibly into a canonicalized string. |
| public String | Returns: the decoded stringa byte array containing the string to decode encodedString)Decode an array of bytes possibly into a canonicalized string. |
| public String | |
| public static Encoding | Returns: an Encoding instanceGet an Encoding using the default encoding for the JVM. |
| public @PolyNull byte[] | |
| public static Encoding | Returns: an Encoding instance for the specified encoding, or an Encoding instance for the default JVM encoding if the specified encoding is unavailable.the name of the database encoding databaseEncoding)Construct an Encoding for a given database encoding. |
| public Reader | Returns: a non-null Reader implementation.the underlying stream to decode from in)Get a Reader that decodes the given InputStream using this encoding. |
| public Writer | Returns: a non-null Writer implementation.the underlying stream to encode to out)Get a Writer that encodes to the given OutputStream using this encoding. |
| public static Encoding | Returns: an Encoding instance for the specified encoding, or an Encoding instance for the default JVM encoding if the specified encoding is unavailable.the name of the JVM encoding jvmEncoding)Construct an Encoding for a given JVM encoding. |
| public boolean | Returns: true if the bytes can be scanned directly for ascii numbers.Returns true if this encoding has characters '-' and '0'..'9' in exactly same position as ascii. |
| public String | |
| private static boolean | Returns: If faster ASCII number parsing can be used with this encoding.Checks whether this encoding is compatible with ASCII for the number characters '-' and '0'..'9'. |
| public String |
| DEFAULT_ENCODING | back to summary |
|---|---|
| private static final Encoding DEFAULT_ENCODING | |
| encoding | back to summary |
|---|---|
| private final Charset encoding | |
| encodings | back to summary |
|---|---|
| private static final HashMap<String, String[]> encodings | |
| fastASCIINumbers | back to summary |
|---|---|
| private final boolean fastASCIINumbers | |
| INTERNER | back to summary |
|---|---|
| pack-priv static final AsciiStringInterner INTERNER | |
| LOGGER | back to summary |
|---|---|
| private static final Logger LOGGER | |
| UTF8_ENCODING | back to summary |
|---|---|
| private static final Encoding UTF8_ENCODING | |
| Encoding | back to summary |
|---|---|
| private Encoding() Uses the default charset of the JVM. | |
| Encoding | back to summary |
|---|---|
| protected Encoding(Charset encoding, boolean fastASCIINumbers) Subclasses may use this constructor if they know in advance of their ASCII number compatibility.
| |
| Encoding | back to summary |
|---|---|
| protected Encoding(Charset encoding) Use the charset passed as parameter and tests at creation time whether the specified encoding is compatible with ASCII numbers.
| |
| canonicalize | back to summary |
|---|---|
| public static void canonicalize(String string) Indicates that string should be staged as a canonicalized value.
This is intended for use with
| |
| decode | back to summary |
|---|---|
| public String decode(byte[] encodedString, int offset, int length) throws IOException Decode an array of bytes into a string.
| |
| decode | back to summary |
|---|---|
| public String decode(byte[] encodedString) throws IOException Decode an array of bytes into a string.
| |
| decodeCanonicalized | back to summary |
|---|---|
| public String decodeCanonicalized(byte[] encodedString, int offset, int length) throws IOException Decode an array of bytes possibly into a canonicalized string.
Only ascii compatible encoding support canonicalization and only ascii
| |
| decodeCanonicalized | back to summary |
|---|---|
| public String decodeCanonicalized(byte[] encodedString) throws IOException Decode an array of bytes possibly into a canonicalized string.
Only ascii compatible encoding support canonicalization and only ascii
| |
| decodeCanonicalizedIfPresent | back to summary |
|---|---|
| public String decodeCanonicalizedIfPresent(byte[] encodedString, int offset, int length) throws IOException | |
| defaultEncoding | back to summary |
|---|---|
| public static Encoding defaultEncoding() Get an Encoding using the default encoding for the JVM.
| |
| encode | back to summary |
|---|---|
| public @PolyNull byte[] encode(@PolyNull String s) throws IOException Encode a string to an array of bytes.
| |
| getDatabaseEncoding | back to summary |
|---|---|
| public static Encoding getDatabaseEncoding(String databaseEncoding) Construct an Encoding for a given database encoding. | |
| getDecodingReader | back to summary |
|---|---|
| public Reader getDecodingReader(InputStream in) throws IOException Get a Reader that decodes the given InputStream using this encoding.
| |
| getEncodingWriter | back to summary |
|---|---|
| public Writer getEncodingWriter(OutputStream out) throws IOException Get a Writer that encodes to the given OutputStream using this encoding.
| |
| getJVMEncoding | back to summary |
|---|---|
| public static Encoding getJVMEncoding(String jvmEncoding) Construct an Encoding for a given JVM encoding. | |
| hasAsciiNumbers | back to summary |
|---|---|
| public boolean hasAsciiNumbers() Returns true if this encoding has characters '-' and '0'..'9' in exactly same position as ascii.
| |
| name | back to summary |
|---|---|
| public String name() Get the name of the (JVM) encoding used.
| |
| testAsciiNumbers | back to summary |
|---|---|
| private static boolean testAsciiNumbers(Charset encoding) Checks whether this encoding is compatible with ASCII for the number characters '-' and '0'..'9'. Where compatible means that they are encoded with exactly same values.
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object.
Satisfying this method's contract implies a non- | |