public class TarUtils
extends java.lang.Object
Constructor and Description |
---|
TarUtils() |
Modifier and Type | Method and Description |
---|---|
static long |
computeCheckSum(byte[] buf)
Compute the checksum of a tar entry header.
|
static int |
getCheckSumOctalBytes(long value,
byte[] buf,
int offset,
int length)
Parse the checksum octal integer from a header buffer.
|
static int |
getLongOctalBytes(long value,
byte[] buf,
int offset,
int length)
Parse an octal long integer from a header buffer.
|
static int |
getNameBytes(java.lang.StringBuffer name,
byte[] buf,
int offset,
int length)
Determine the number of bytes in an entry name.
|
static int |
getOctalBytes(long value,
byte[] buf,
int offset,
int length)
Parse an octal integer from a header buffer.
|
static java.lang.StringBuffer |
parseName(byte[] header,
int offset,
int length)
Parse an entry name from a header buffer.
|
static long |
parseOctal(byte[] header,
int offset,
int length)
Parse an octal string from a header buffer.
|
public static long parseOctal(byte[] header, int offset, int length)
header
- The header buffer from which to parse.offset
- The offset into the buffer from which to parse.length
- The number of header bytes to parse.public static java.lang.StringBuffer parseName(byte[] header, int offset, int length)
header
- The header buffer from which to parse.offset
- The offset into the buffer from which to parse.length
- The number of header bytes to parse.public static int getNameBytes(java.lang.StringBuffer name, byte[] buf, int offset, int length)
name
- The header name from which to parse.buf
- The buffer from which to parse.offset
- The offset into the buffer from which to parse.length
- The number of header bytes to parse.public static int getOctalBytes(long value, byte[] buf, int offset, int length)
value
- The header valuebuf
- The buffer from which to parse.offset
- The offset into the buffer from which to parse.length
- The number of header bytes to parse.public static int getLongOctalBytes(long value, byte[] buf, int offset, int length)
value
- The header valuebuf
- The buffer from which to parse.offset
- The offset into the buffer from which to parse.length
- The number of header bytes to parse.public static int getCheckSumOctalBytes(long value, byte[] buf, int offset, int length)
value
- The header valuebuf
- The buffer from which to parse.offset
- The offset into the buffer from which to parse.length
- The number of header bytes to parse.public static long computeCheckSum(byte[] buf)
buf
- The tar entry's header buffer.