org.codehaus.plexus.archiver.tar
Class TarUtils
java.lang.Objectorg.codehaus.plexus.archiver.tar.TarUtils
public class TarUtils
extends java.lang.Object
This class provides static utility methods to work with byte streams.
$Revision: 2436 $ $Date: 2005-09-01 13:20:41 -0400 (Thu, 01 Sep 2005) $
from org.apache.ant.tools.tar.TarUtils v1.11static 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(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 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.
|
computeCheckSum
public static long computeCheckSum(byte[] buf)
Compute the checksum of a tar entry header.
buf - The tar entry's header buffer.
getCheckSumOctalBytes
public static int getCheckSumOctalBytes(long value,
byte[] buf,
int offset,
int length) Parse the checksum octal integer from a header buffer.
value - The header valueoffset - The offset into the buffer from which to parse.length - The number of header bytes to parse.
- The integer value of the entry's checksum.
getLongOctalBytes
public static int getLongOctalBytes(long value,
byte[] buf,
int offset,
int length) Parse an octal long integer from a header buffer.
value - The header valueoffset - The offset into the buffer from which to parse.length - The number of header bytes to parse.
- The long value of the octal bytes.
getNameBytes
public static int getNameBytes(StringBuffer name,
byte[] buf,
int offset,
int length) Determine the number of bytes in an entry name.
name - The header name from which to parse.offset - The offset into the buffer from which to parse.length - The number of header bytes to parse.
- The number of bytes in a header's entry name.
getOctalBytes
public static int getOctalBytes(long value,
byte[] buf,
int offset,
int length) Parse an octal integer from a header buffer.
value - The header valueoffset - The offset into the buffer from which to parse.length - The number of header bytes to parse.
- The integer value of the octal bytes.
parseName
public static StringBuffer parseName(byte[] header,
int offset,
int length) Parse an entry name from a header buffer.
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.
parseOctal
public static long parseOctal(byte[] header,
int offset,
int length) Parse an octal string from a header buffer. This is used for the
file permission mode value.
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.
- The long value of the octal string.