Class DumpArchiveUtil
java.lang.Object
org.apache.commons.compress.archivers.dump.DumpArchiveUtil
Various utilities for dump archives.
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprivate
Private constructor to prevent instantiation. -
Method Summary
Modifier and TypeMethodDescriptionstatic int
calculateChecksum
(byte[] buffer) Calculate checksum for buffer.static final int
convert16
(byte[] buffer, int offset) Read 2-byte integer from buffer.static final int
convert32
(byte[] buffer, int offset) Read 4-byte integer from buffer.static final long
convert64
(byte[] buffer, int offset) Read 8-byte integer from buffer.(package private) static String
decode
(ZipEncoding encoding, byte[] b, int offset, int len) Decodes a byte array to a string.static final int
getIno
(byte[] buffer) Get the ino associated with this buffer.static final boolean
verify
(byte[] buffer) Verify that the buffer contains a tape segment header.
-
Constructor Details
-
DumpArchiveUtil
private DumpArchiveUtil()Private constructor to prevent instantiation.
-
-
Method Details
-
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
Decodes a byte array to a string.- Throws:
IOException
-