public class ArchiveUtils
extends java.lang.Object
Modifier | Constructor and Description |
---|---|
private |
ArchiveUtils()
Private constructor to prevent instantiation of this utility class.
|
Modifier and Type | Method and Description |
---|---|
static boolean |
isEqual(byte[] buffer1,
byte[] buffer2)
Compare byte buffers
|
static boolean |
isEqual(byte[] buffer1,
byte[] buffer2,
boolean ignoreTrailingNulls)
Compare byte buffers, optionally ignoring trailing nulls
|
static boolean |
isEqual(byte[] buffer1,
int offset1,
int length1,
byte[] buffer2,
int offset2,
int length2)
Compare byte buffers
|
static boolean |
isEqual(byte[] buffer1,
int offset1,
int length1,
byte[] buffer2,
int offset2,
int length2,
boolean ignoreTrailingNulls)
Compare byte buffers, optionally ignoring trailing nulls
|
static boolean |
isEqualWithNull(byte[] buffer1,
int offset1,
int length1,
byte[] buffer2,
int offset2,
int length2)
Compare byte buffers, ignoring trailing nulls
|
static boolean |
matchAsciiBuffer(java.lang.String expected,
byte[] buffer)
Check if buffer contents matches Ascii String.
|
static boolean |
matchAsciiBuffer(java.lang.String expected,
byte[] buffer,
int offset,
int length)
Check if buffer contents matches Ascii String.
|
static byte[] |
toAsciiBytes(java.lang.String inputString)
Convert a string to Ascii bytes.
|
static java.lang.String |
toAsciiString(byte[] inputBytes)
Convert an input byte array to a String using the ASCII character set.
|
static java.lang.String |
toAsciiString(byte[] inputBytes,
int offset,
int length)
Convert an input byte array to a String using the ASCII character set.
|
static java.lang.String |
toString(ArchiveEntry entry)
Generates a string containing the name, isDirectory setting and size of an entry.
|
private ArchiveUtils()
public static java.lang.String toString(ArchiveEntry entry)
For example:
- 2000 main.c
d 100 testfiles
public static boolean matchAsciiBuffer(java.lang.String expected, byte[] buffer, int offset, int length)
expected
- buffer
- offset
- length
- true
if buffer is the same as the expected stringpublic static boolean matchAsciiBuffer(java.lang.String expected, byte[] buffer)
expected
- buffer
- true
if buffer is the same as the expected stringpublic static byte[] toAsciiBytes(java.lang.String inputString)
inputString
- public static java.lang.String toAsciiString(byte[] inputBytes)
inputBytes
- public static java.lang.String toAsciiString(byte[] inputBytes, int offset, int length)
inputBytes
- input byte arrayoffset
- offset within arraylength
- length of arraypublic static boolean isEqual(byte[] buffer1, int offset1, int length1, byte[] buffer2, int offset2, int length2, boolean ignoreTrailingNulls)
buffer1
- offset1
- length1
- buffer2
- offset2
- length2
- ignoreTrailingNulls
- true
if buffer1 and buffer2 have same contents, having regard to trailing nullspublic static boolean isEqual(byte[] buffer1, int offset1, int length1, byte[] buffer2, int offset2, int length2)
buffer1
- offset1
- length1
- buffer2
- offset2
- length2
- true
if buffer1 and buffer2 have same contentspublic static boolean isEqual(byte[] buffer1, byte[] buffer2)
buffer1
- buffer2
- true
if buffer1 and buffer2 have same contentspublic static boolean isEqual(byte[] buffer1, byte[] buffer2, boolean ignoreTrailingNulls)
buffer1
- buffer2
- ignoreTrailingNulls
- true
if buffer1 and buffer2 have same contentspublic static boolean isEqualWithNull(byte[] buffer1, int offset1, int length1, byte[] buffer2, int offset2, int length2)
buffer1
- offset1
- length1
- buffer2
- offset2
- length2
- true
if buffer1 and buffer2 have same contents, having regard to trailing nulls