Top Description Constructors Methods
org.apache.commons.compress.archivers.dump

pack-priv final Class DumpArchiveUtil

extends Object
Class Inheritance
Imports
java.io.IOException, java.util.Arrays, org.apache.commons.compress.archivers.zip.ZipEncoding, org.apache.commons.compress.utils.ByteUtils

Various utilities for dump archives.

Constructor Summary

AccessConstructor and Description
private
DumpArchiveUtil()

Private constructor to prevent instantiation.

Method Summary

Modifier and TypeMethod and Description
public static int

Returns:

checksum
calculateChecksum
(final byte[]
buffer containing tape segment header
buffer
)

Calculate checksum for buffer.

public static int

Returns:

the 2-byte entry as an int.
convert16
(final byte[]
The source buffer.
buffer
,
final int
Where to start reading.
offset
)

Reads 2-byte integer from buffer.

public static int

Returns:

the 4-byte entry as an int.
convert32
(final byte[]
The source buffer.
buffer
,
final int
Where to start reading.
offset
)

Reads 4-byte integer from buffer.

public static long

Returns:

the 8-byte entry as a long.
convert64
(final byte[]
The source buffer.
buffer
,
final int
Where to start reading.
offset
)

Reads 8-byte integer from buffer.

pack-priv static String
decode(final ZipEncoding encoding, final byte[] b, final int offset, final int len)

Decodes a byte array to a string.

public static int

Returns:

the ino associated with this buffer.
getIno
(final byte[]
The source buffer.
buffer
)

Gets the ino associated with this buffer.

public static boolean

Returns:

Whether the buffer contains a tape segment header.
verify
(final byte[]
The source buffer.
buffer
)

Verifies that the buffer contains a tape segment header.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

DumpArchiveUtilback to summary
private DumpArchiveUtil()

Private constructor to prevent instantiation.

Method Detail

calculateChecksumback to summary
public static int calculateChecksum(final byte[] buffer)

Calculate checksum for buffer.

Parameters
buffer:byte[]

buffer containing tape segment header

Returns:int

checksum

convert16back to summary
public static int convert16(final byte[] buffer, final int offset)

Reads 2-byte integer from buffer.

Parameters
buffer:byte[]

The source buffer.

offset:int

Where to start reading.

Returns:int

the 2-byte entry as an int.

convert32back to summary
public static int convert32(final byte[] buffer, final int offset)

Reads 4-byte integer from buffer.

Parameters
buffer:byte[]

The source buffer.

offset:int

Where to start reading.

Returns:int

the 4-byte entry as an int.

convert64back to summary
public static long convert64(final byte[] buffer, final int offset)

Reads 8-byte integer from buffer.

Parameters
buffer:byte[]

The source buffer.

offset:int

Where to start reading.

Returns:long

the 8-byte entry as a long.

decodeback to summary
pack-priv static String decode(final ZipEncoding encoding, final byte[] b, final int offset, final int len) throws IOException

Decodes a byte array to a string.

getInoback to summary
public static int getIno(final byte[] buffer)

Gets the ino associated with this buffer.

Parameters
buffer:byte[]

The source buffer.

Returns:int

the ino associated with this buffer.

verifyback to summary
public static boolean verify(final byte[] buffer)

Verifies that the buffer contains a tape segment header.

Parameters
buffer:byte[]

The source buffer.

Returns:boolean

Whether the buffer contains a tape segment header.