Class DumpArchiveUtil
- java.lang.Object
-
- org.apache.commons.compress.archivers.dump.DumpArchiveUtil
-
final class DumpArchiveUtil extends java.lang.Object
Various utilities for dump archives.
-
-
Constructor Summary
Constructors Modifier Constructor Description private
DumpArchiveUtil()
Private constructor to prevent instantiation.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static int
calculateChecksum(byte[] buffer)
Calculate checksum for buffer.static int
convert16(byte[] buffer, int offset)
Reads 2-byte integer from buffer.static int
convert32(byte[] buffer, int offset)
Reads 4-byte integer from buffer.static long
convert64(byte[] buffer, int offset)
Reads 8-byte integer from buffer.(package private) static java.lang.String
decode(ZipEncoding encoding, byte[] b, int offset, int len)
Decodes a byte array to a string.static int
getIno(byte[] buffer)
Gets the ino associated with this buffer.static boolean
verify(byte[] buffer)
Verifies 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- Returns:
- checksum
-
convert16
public static final int convert16(byte[] buffer, int offset)
Reads 2-byte integer from buffer.- Parameters:
buffer
- The source buffer.offset
- Where to start reading.- Returns:
- the 2-byte entry as an int.
-
convert32
public static final int convert32(byte[] buffer, int offset)
Reads 4-byte integer from buffer.- Parameters:
buffer
- The source buffer.offset
- Where to start reading.- Returns:
- the 4-byte entry as an int.
-
convert64
public static final long convert64(byte[] buffer, int offset)
Reads 8-byte integer from buffer.- Parameters:
buffer
- The source buffer.offset
- Where to start reading.- Returns:
- the 8-byte entry as a long.
-
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
-
getIno
public static final int getIno(byte[] buffer)
Gets the ino associated with this buffer.- Parameters:
buffer
- The source buffer.- Returns:
- the ino associated with this buffer.
-
verify
public static final boolean verify(byte[] buffer)
Verifies that the buffer contains a tape segment header.- Parameters:
buffer
- The source buffer.- Returns:
- Whether the buffer contains a tape segment header.
-
-