These restrictions most notably apply to the most prominent
omissions of Java 1.4 Charset
implementation, Cp437 and Cp850.
The methods of this class are reentrant.
| Modifier and Type | Class and Description |
|---|---|
| private static class | Simple8BitZipEncoding.
A character entity, which is put to the reverse mapping table of a simple encoding. |
| Modifier and Type | Field and Description |
|---|---|
| private final char[] | highChars
The characters for byte values of 128 to 255 stored as an array of 128 chars. |
| private final List | reverseMapping
A list of |
| Access | Constructor and Description |
|---|---|
| public | Simple8BitZipEncoding(final char[]
The characters for byte values of 128 to 255
stored as an array of 128 chars. highChars)
|
| Modifier and Type | Method and Description |
|---|---|
| public boolean | canEncode(final String
A filename or ZIP comment. name)Implements org. |
| public boolean | Returns: Whether the given unicode character is covered by this encoding.The character to encode. c)
|
| public String | decode(final byte[]
The byte values to decode. data)Implements org. |
| public char | Returns: The associated character value.The byte to decode. b)Return the character code for a given encoded byte. |
| public ByteBuffer | encode(final String
A filename or ZIP comment. name)Implements org. |
| private Simple8BitZipEncoding. | Returns: A Simple8BitChar, if this character is covered by this encoding. Anull value is returned, if this character is not
covered by this encoding.A unicode character in the range from 0x0080 to 0x7f00 c)
|
| public boolean | Returns: Whether the given unicode character is covered by this encoding. Iffalse is returned, nothing is pushed to the
byte buffer.The byte buffer to write to. bb, final char The character to encode. c)Pushes the encoded form of the given character to the given byte buffer. |
| highChars | back to summary |
|---|---|
| private final char[] highChars The characters for byte values of 128 to 255 stored as an array of 128 chars. | |
| reverseMapping | back to summary |
|---|---|
| private final List<Simple8BitZipEncoding. A list of | |
| Simple8BitZipEncoding | back to summary |
|---|---|
public Simple8BitZipEncoding(final char[] highChars)
| |
| canEncode | back to summary |
|---|---|
| public boolean canEncode(final String name) Implements org. Doc from org. Check, whether the given string may be losslessly encoded using this encoding.
| |
| canEncodeChar | back to summary |
|---|---|
public boolean canEncodeChar(final char c)
| |
| decode | back to summary |
|---|---|
| public String decode(final byte[] data) throws IOException Implements org.
| |
| decodeByte | back to summary |
|---|---|
| public char decodeByte(final byte b) Return the character code for a given encoded byte.
| |
| encode | back to summary |
|---|---|
| public ByteBuffer encode(final String name) Implements org. Doc from org. Encode a filename or a comment to a byte array suitable for storing it to a serialized zip entry. Examples for CP 437 (in pseudo-notation, right hand side is C-style notation):
encode("€_for_Dollar.txt") = "%U20AC_for_Dollar.txt"
encode("Ölfässer.txt") = "\231lf\204sser.txt"
| |
| encodeHighChar | back to summary |
|---|---|
private Simple8BitZipEncoding.
| |
| pushEncodedChar | back to summary |
|---|---|
| public boolean pushEncodedChar(final ByteBuffer bb, final char c) Pushes the encoded form of the given character to the given byte buffer.
| |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public int | compareTo(final Simple8BitZipEncoding.
the object to be compared. aImplements java. |
| public boolean | equals(final Object
the reference object with which to compare. o)Overrides java. |
| public int | |
| public String |
| code | back to summary |
|---|---|
| public final byte code | |
| unicode | back to summary |
|---|---|
| public final char unicode | |
| Simple8BitChar | back to summary |
|---|---|
| pack-priv Simple8BitChar(final byte code, final char unicode) | |
| compareTo | back to summary |
|---|---|
| public int compareTo(final Simple8BitZipEncoding. Implements java. Doc from java. Compares this object with the specified object for order. Returns a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object. The implementor must ensure The implementor must also ensure that the relation is transitive:
Finally, the implementor must ensure that
| |
| equals | back to summary |
|---|---|
| public boolean equals(final Object o) Overrides java. Doc from java. Indicates whether some other object is "equal to" this one.
The
An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes. | |
| hashCode | back to summary |
|---|---|
| public int hashCode() Overrides java. Doc from java. Returns a hash code value for this object. This method is
supported for the benefit of hash tables such as those provided by
The general contract of
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object. | |