Class DumpArchiveUtil
- java.lang.Object
-
- org.apache.commons.compress.archivers.dump.DumpArchiveUtil
-
class DumpArchiveUtil extends java.lang.ObjectVarious utilities for dump archives.
-
-
Constructor Summary
Constructors Modifier Constructor Description privateDumpArchiveUtil()Private constructor to prevent instantiation.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static intcalculateChecksum(byte[] buffer)Calculate checksum for buffer.static intconvert16(byte[] buffer, int offset)Read 2-byte integer from buffer.static intconvert32(byte[] buffer, int offset)Read 4-byte integer from buffer.static longconvert64(byte[] buffer, int offset)Read 8-byte integer from buffer.(package private) static java.lang.Stringdecode(ZipEncoding encoding, byte[] b, int offset, int len)Decodes a byte array to a string.static intgetIno(byte[] buffer)Get the ino associated with this buffer.static booleanverify(byte[] buffer)Verify that the buffer contains a tape segment header.
-
-
-
Method Detail
-
calculateChecksum
public static int calculateChecksum(byte[] buffer)
Calculate checksum for buffer.- Parameters:
buffer- buffer containing tape segment header
-
verify
public static final boolean verify(byte[] buffer)
Verify that the buffer contains a tape segment header.- Parameters:
buffer-
-
getIno
public static final int getIno(byte[] buffer)
Get the ino associated with this buffer.- Parameters:
buffer-
-
convert64
public static final long convert64(byte[] buffer, int offset)Read 8-byte integer from buffer.- Parameters:
buffer-offset-- Returns:
- the 8-byte entry as a long
-
convert32
public static final int convert32(byte[] buffer, int offset)Read 4-byte integer from buffer.- Parameters:
buffer-offset-- Returns:
- the 4-byte entry as an int
-
convert16
public static final int convert16(byte[] buffer, int offset)Read 2-byte integer from buffer.- Parameters:
buffer-offset-- Returns:
- the 2-byte entry as an int
-
decode
static java.lang.String decode(ZipEncoding encoding, byte[] b, int offset, int len) throws java.io.IOException
Decodes a byte array to a string.- Throws:
java.io.IOException
-
-