|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.commons.compress.archivers.zip.ZipEncodingHelper
abstract class ZipEncodingHelper
Static helper functions for robustly encoding filenames in zip files.
| Nested Class Summary | |
|---|---|
private static class |
ZipEncodingHelper.SimpleEncodingHolder
A class, which holds the high characters of a simple encoding and lazily instantiates a Simple8BitZipEncoding instance in a thread-safe manner. |
| Field Summary | |
|---|---|
private static byte[] |
HEX_DIGITS
The hexadecimal digits 0,...,9,A,...,F encoded as
ASCII bytes. |
private static java.util.Map |
simpleEncodings
|
private static java.lang.String |
UTF_DASH_8
variant name of the encoding UTF-8 used for comparisions. |
(package private) static java.lang.String |
UTF8
name of the encoding UTF-8 |
(package private) static ZipEncoding |
UTF8_ZIP_ENCODING
name of the encoding UTF-8 |
| Constructor Summary | |
|---|---|
ZipEncodingHelper()
|
|
| Method Summary | |
|---|---|
(package private) static void |
appendSurrogate(java.nio.ByteBuffer bb,
char c)
Append %Uxxxx to the given byte buffer. |
(package private) static ZipEncoding |
getZipEncoding(java.lang.String name)
Instantiates a zip encoding. |
(package private) static java.nio.ByteBuffer |
growBuffer(java.nio.ByteBuffer b,
int newCapacity)
Grow a byte buffer, so it has a minimal capacity or at least the double capacity of the original buffer |
(package private) static boolean |
isUTF8(java.lang.String encoding)
Whether a given encoding - or the platform's default encoding if the parameter is null - is UTF-8. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private static final java.util.Map simpleEncodings
private static final byte[] HEX_DIGITS
0,...,9,A,...,F encoded as
ASCII bytes.
static final java.lang.String UTF8
private static final java.lang.String UTF_DASH_8
static final ZipEncoding UTF8_ZIP_ENCODING
| Constructor Detail |
|---|
ZipEncodingHelper()
| Method Detail |
|---|
static java.nio.ByteBuffer growBuffer(java.nio.ByteBuffer b,
int newCapacity)
b - The original buffer.newCapacity - The minimal requested new capacity.
r with
r.capacity() = max(b.capacity()*2,newCapacity) and
all the data contained in b copied to the beginning
of r.
static void appendSurrogate(java.nio.ByteBuffer bb,
char c)
%Uxxxx to the given byte buffer.
The caller must assure, that bb.remaining()>=6.
bb - The byte buffer to write to.c - The character to write.static ZipEncoding getZipEncoding(java.lang.String name)
name - The name of the zip encoding. Specify null for
the platform's default encoding.
static boolean isUTF8(java.lang.String encoding)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||