| Modifier and Type | Field and Description |
|---|---|
| private static final int |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public static boolean | Returns: true if the first N bytes are zeroThe array to check a, final int The number of characters to check (not the size of the array) size)Returns true if the first N bytes of an array are all zero |
| public static boolean | Returns: true if buffer1 and buffer2 have same contentsthe first buffer buffer1, final byte[] the second buffer buffer2)
Deprecated
Use
Compare byte buffers
Arrays#equals(byte[], byte[]).
|
| public static boolean | Returns: true if buffer1 and buffer2 have same contentsthe first buffer buffer1, final byte[] the second buffer buffer2, final boolean whether to ignore trailing nulls ignoreTrailingNulls)Compare byte buffers, optionally ignoring trailing nulls |
| public static boolean | Returns: true if buffer1 and buffer2 have same contentsthe first buffer buffer1, final int the first offset offset1, final int the first length length1, final byte[] the second buffer buffer2, final int the second offset offset2, final int the second length length2)Compare byte buffers |
| public static boolean | Returns: true if buffer1 and buffer2 have same contents, having regard to trailing nullsfirst buffer buffer1, final int first offset offset1, final int first length length1, final byte[] second buffer buffer2, final int second offset offset2, final int second length length2, final boolean whether to ignore trailing nulls ignoreTrailingNulls)Compare byte buffers, optionally ignoring trailing nulls |
| public static boolean | Returns: true if buffer1 and buffer2 have same contents, having regard to trailing nullsthe first buffer buffer1, final int the first offset offset1, final int the first length length1, final byte[] the second buffer buffer2, final int the second offset offset2, final int the second length length2)Compare byte buffers, ignoring trailing nulls |
| public static boolean | Returns: true if buffer is the same as the expected stringthe expected string expected, final byte[] the buffer buffer)Check if buffer contents matches ASCII String. |
| public static boolean | Returns: true if buffer is the same as the expected stringexpected string expected, final byte[] the buffer buffer, final int offset to read from offset, final int length of the buffer length)Check if buffer contents matches ASCII String. |
| public static String | |
| public static byte[] | Returns: the bytesstring to convert inputString)Convert a string to ASCII bytes. |
| public static String | Returns: the bytes, interpreted as an ASCII stringbytes to convert inputBytes)Convert an input byte array to a String using the ASCII character set. |
| public static String | Returns: the bytes, interpreted as an ASCII stringinput byte array inputBytes, final int offset within array offset, final int length of array length)Convert an input byte array to a String using the ASCII character set. |
| public static String | Returns: the representation of the entrythe entry entry)Generates a string containing the name, isDirectory setting and size of an entry. |
| MAX_SANITIZED_NAME_LENGTH | back to summary |
|---|---|
| private static final int MAX_SANITIZED_NAME_LENGTH | |
| ArchiveUtils | back to summary |
|---|---|
| private ArchiveUtils() Private constructor to prevent instantiation of this utility class. | |
| isArrayZero | back to summary |
|---|---|
| public static boolean isArrayZero(final byte[] a, final int size) Returns true if the first N bytes of an array are all zero
| |
| isEqual | back to summary |
|---|---|
| public static boolean isEqual(final byte[] buffer1, final byte[] buffer2)
Deprecated Compare byte buffers
| |
| isEqual | back to summary |
|---|---|
| public static boolean isEqual(final byte[] buffer1, final byte[] buffer2, final boolean ignoreTrailingNulls) Compare byte buffers, optionally ignoring trailing nulls
| |
| isEqual | back to summary |
|---|---|
| public static boolean isEqual(final byte[] buffer1, final int offset1, final int length1, final byte[] buffer2, final int offset2, final int length2) Compare byte buffers
| |
| isEqual | back to summary |
|---|---|
| public static boolean isEqual(final byte[] buffer1, final int offset1, final int length1, final byte[] buffer2, final int offset2, final int length2, final boolean ignoreTrailingNulls) Compare byte buffers, optionally ignoring trailing nulls
| |
| isEqualWithNull | back to summary |
|---|---|
| public static boolean isEqualWithNull(final byte[] buffer1, final int offset1, final int length1, final byte[] buffer2, final int offset2, final int length2) Compare byte buffers, ignoring trailing nulls
| |
| matchAsciiBuffer | back to summary |
|---|---|
| public static boolean matchAsciiBuffer(final String expected, final byte[] buffer) Check if buffer contents matches ASCII String.
| |
| matchAsciiBuffer | back to summary |
|---|---|
| public static boolean matchAsciiBuffer(final String expected, final byte[] buffer, final int offset, final int length) Check if buffer contents matches ASCII String.
| |
| sanitize | back to summary |
|---|---|
| public static String sanitize(final String s) Returns a "sanitized" version of the string given as arguments, where sanitized means non-printable characters have been replaced with a question mark and the outcome is not longer than 255 chars. This method is used to clean up file names when they are used in exception messages as they may end up in log files or as console output and may have been read from a corrupted input. | |
| toAsciiBytes | back to summary |
|---|---|
| public static byte[] toAsciiBytes(final String inputString) Convert a string to ASCII bytes. Used for comparing "magic" strings which need to be independent of the default Locale.
| |
| toAsciiString | back to summary |
|---|---|
| public static String toAsciiString(final byte[] inputBytes) Convert an input byte array to a String using the ASCII character set.
| |
| toAsciiString | back to summary |
|---|---|
| public static String toAsciiString(final byte[] inputBytes, final int offset, final int length) Convert an input byte array to a String using the ASCII character set.
| |
| toString | back to summary |
|---|---|
| public static String toString(final ArchiveEntry entry) Generates a string containing the name, isDirectory setting and size of an entry. For example: - 2000 main.c d 100 testfiles
| |