Modifier and Type | Field and Description |
---|---|
private static final int | |
pack-priv static final ZipEncoding | |
pack-priv static final ZipEncoding | FALLBACK_ENCODING
Encapsulates the algorithms used up to Ant 1.8 as ZipEncoding. |
private static final String | |
private static final WeakHashMap | |
private static final String | |
private static final String |
Access | Constructor and Description |
---|---|
private |
Modifier and Type | Method and Description |
---|---|
public static long | Returns: The computed checksum.The tar entry's header buffer. buf)Compute the checksum of a tar entry header. |
private static String | exceptionMessage(final byte[] buffer, final int offset, final int length, final int current, final byte currentByte)
|
private static void | formatBigIntegerBinary(final long value, final byte[] buf, final int offset, final int length, final boolean negative)
|
public static int | Returns: The updated value of offset, i.e. offset+lengthThe value to convert value, final byte[] The destination buffer buf, final int The starting offset into the buffer. offset, final int The size of the buffer. length)Writes an octal value into a buffer. |
private static void | formatLongBinary(final long value, final byte[] buf, final int offset, final int length, final boolean negative)
|
public static int | Returns: The updated offsetThe value to write as octal value, final byte[] The destinationbuffer. buf, final int The starting offset into the buffer. offset, final int The length of the buffer length)Write an octal long integer into a buffer. |
public static int | Returns: The updated offset.The value to write into the buffer. value, final byte[] The destination buffer. buf, final int The starting offset into the buffer. offset, final int The length of the buffer. length)Write an long integer into a buffer as an octal string if this will fit, or as a binary number otherwise. |
public static int | Returns: The updated offset, i.e. offset + lengthThe header name from which to copy the characters. name, final byte[] The buffer where the name is to be stored. buf, final int The starting offset into the buffer offset, final int The maximum number of header bytes to copy. length)Copy a name into a buffer. |
public static int | Returns: The updated offset, i.e. offset + lengthThe header name from which to copy the characters. name, final byte[] The buffer where the name is to be stored. buf, final int The starting offset into the buffer offset, final int The maximum number of header bytes to copy. length, final ZipEncoding name of the encoding to use for file names encoding)Copy a name into a buffer. |
public static int | Returns: The updated offset, i.e offset+lengthThe value to write value, final byte[] The buffer to receive the output buf, final int The starting offset into the buffer offset, final int The size of the output buffer length)Write an octal integer into a buffer. |
public static void | formatUnsignedOctalString(final long
number to convert to octal - treated as unsigned value, final byte[] destination buffer buffer, final int starting offset in buffer offset, final int length of buffer to fill length)Fill buffer with unsigned octal number, padded with leading zeroes. |
private static byte[] | |
private static byte[] | |
private static long | parseBinaryBigInteger(final byte[] buffer, final int offset, final int length, final boolean negative)
|
private static long | |
public static boolean | Returns: The boolean value of the bytes.The buffer from which to parse. buffer, final int The offset into the buffer from which to parse. offset)Parse a boolean byte from a buffer. |
public static String | Returns: The entry name.The buffer from which to parse. buffer, final int The offset into the buffer from which to parse. offset, final int The maximum number of bytes to parse. length)Parse an entry name from a buffer. |
public static String | Returns: The entry name.The buffer from which to parse. buffer, final int The offset into the buffer from which to parse. offset, final int The maximum number of bytes to parse. length, final ZipEncoding name of the encoding to use for file names encoding)Parse an entry name from a buffer. |
public static long | Returns: The long value of the octal string.The buffer from which to parse. buffer, final int The offset into the buffer from which to parse. offset, final int The maximum number of bytes to parse - must be at least 2 bytes. length)Parse an octal string from a buffer. |
public static long | Returns: The long value of the octal or binary string.The buffer from which to parse. buffer, final int The offset into the buffer from which to parse. offset, final int The maximum number of bytes to parse. length)Compute the value contained in a byte buffer. |
BYTE_MASK | back to summary |
---|---|
private static final int BYTE_MASK |
DEFAULT_ENCODING | back to summary |
---|---|
pack-priv static final ZipEncoding DEFAULT_ENCODING |
FALLBACK_ENCODING | back to summary |
---|---|
pack-priv static final ZipEncoding FALLBACK_ENCODING Encapsulates the algorithms used up to Ant 1.8 as ZipEncoding. |
NUL | back to summary |
---|---|
private static final String NUL |
NUL_BY_ENCODING | back to summary |
---|---|
private static final WeakHashMap<ZipEncoding, byte[]> NUL_BY_ENCODING |
X | back to summary |
---|---|
private static final String X |
X_NUL | back to summary |
---|---|
private static final String X_NUL |
TarUtils | back to summary |
---|---|
private TarUtils() Private constructor to prevent instantiation of this utility class. |
computeCheckSum | back to summary |
---|---|
public static long computeCheckSum(final byte[] buf) Compute the checksum of a tar entry header.
|
exceptionMessage | back to summary |
---|---|
private static String exceptionMessage(final byte[] buffer, final int offset, final int length, final int current, final byte currentByte) |
formatBigIntegerBinary | back to summary |
---|---|
private static void formatBigIntegerBinary(final long value, final byte[] buf, final int offset, final int length, final boolean negative) |
formatCheckSumOctalBytes | back to summary |
---|---|
public static int formatCheckSumOctalBytes(final long value, final byte[] buf, final int offset, final int length) Writes an octal value into a buffer.
Uses
|
formatLongBinary | back to summary |
---|---|
private static void formatLongBinary(final long value, final byte[] buf, final int offset, final int length, final boolean negative) |
formatLongOctalBytes | back to summary |
---|---|
public static int formatLongOctalBytes(final long value, final byte[] buf, final int offset, final int length) Write an octal long integer into a buffer.
Uses
|
formatLongOctalOrBinaryBytes | back to summary |
---|---|
public static int formatLongOctalOrBinaryBytes(final long value, final byte[] buf, final int offset, final int length) Write an long integer into a buffer as an octal string if this
will fit, or as a binary number otherwise.
Uses
|
formatNameBytes | back to summary |
---|---|
public static int formatNameBytes(final String name, final byte[] buf, final int offset, final int length) Copy a name into a buffer. Copies characters from the name into the buffer starting at the specified offset. If the buffer is longer than the name, the buffer is filled with trailing NULs. If the name is longer than the buffer, the output is truncated.
|
formatNameBytes | back to summary |
---|---|
public static int formatNameBytes(final String name, final byte[] buf, final int offset, final int length, final ZipEncoding encoding) throws IOException Copy a name into a buffer. Copies characters from the name into the buffer starting at the specified offset. If the buffer is longer than the name, the buffer is filled with trailing NULs. If the name is longer than the buffer, the output is truncated.
|
formatOctalBytes | back to summary |
---|---|
public static int formatOctalBytes(final long value, final byte[] buf, final int offset, final int length) Write an octal integer into a buffer.
Uses
|
formatUnsignedOctalString | back to summary |
---|---|
public static void formatUnsignedOctalString(final long value, final byte[] buffer, final int offset, final int length) Fill buffer with unsigned octal number, padded with leading zeroes.
|
getNulByteEquivalent | back to summary |
---|---|
private static byte[] getNulByteEquivalent(ZipEncoding encoding) throws IOException |
getUncachedNulByteEquivalent | back to summary |
---|---|
private static byte[] getUncachedNulByteEquivalent(ZipEncoding encoding) throws IOException |
parseBinaryBigInteger | back to summary |
---|---|
private static long parseBinaryBigInteger(final byte[] buffer, final int offset, final int length, final boolean negative) |
parseBinaryLong | back to summary |
---|---|
private static long parseBinaryLong(final byte[] buffer, final int offset, final int length, final boolean negative) |
parseBoolean | back to summary |
---|---|
public static boolean parseBoolean(final byte[] buffer, final int offset) Parse a boolean byte from a buffer. Leading spaces and NUL are ignored. The buffer may contain trailing spaces or NULs.
|
parseName | back to summary |
---|---|
public static String parseName(final byte[] buffer, final int offset, final int length) Parse an entry name from a buffer. Parsing stops when a NUL is found or the buffer length is reached.
|
parseName | back to summary |
---|---|
public static String parseName(final byte[] buffer, final int offset, final int length, final ZipEncoding encoding) throws IOException Parse an entry name from a buffer. Parsing stops when a NUL is found or the buffer length is reached.
|
parseOctal | back to summary |
---|---|
public static long parseOctal(final byte[] buffer, final int offset, final int length) Parse an octal string from a buffer. Leading spaces are ignored. The buffer must contain a trailing space or NUL, and may contain an additional trailing space or NUL. The input buffer is allowed to contain all NULs, in which case the method returns 0L (this allows for missing fields). To work-around some tar implementations that insert a leading NUL this method returns 0 if it detects a leading NUL since Ant 1.9.
|
parseOctalOrBinary | back to summary |
---|---|
public static long parseOctalOrBinary(final byte[] buffer, final int offset, final int length) Compute the value contained in a byte buffer. If the most significant bit of the first byte in the buffer is set, this bit is ignored and the rest of the buffer is interpreted as a binary number. Otherwise, the buffer is interpreted as an octal number as per the parseOctal function above.
|