|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectuk.org.retep.util.io.tar.TarHeader
public abstract class TarHeader
Base class for all TarHeader's
| Nested Class Summary | |
|---|---|
static class |
TarHeader.FileHeader
Base class for file entries |
static class |
TarHeader.NamedHeader
Base class of all TarHeader's that use the name field. |
| Field Summary | |
|---|---|
static int |
BLOCK_SIZE
The size of a TarHeader block |
protected java.lang.String |
chksum
|
static int |
CHKSUM_SIZE
|
protected int |
devmajor
|
static int |
DEVMAJOR_SIZE
|
protected int |
devminor
|
static int |
DEVMINOR_SIZE
|
protected int |
gid
|
static int |
GID_SIZE
|
protected java.lang.String |
gname
|
static int |
GNAME_SIZE
|
protected java.lang.String |
linkname
|
static int |
LINKNAME_SIZE
|
protected int |
mode
|
static int |
MODE_SIZE
|
protected long |
mtime
|
static int |
MTIME_SIZE
|
protected java.lang.String |
name
|
static int |
NAME_SIZE
|
protected java.lang.String |
prefix
|
static int |
PREFIX_SIZE
|
protected TarHeader |
prevHeader
The TarHeader to write prior to this one |
protected long |
size
|
static int |
SIZE_SIZE
|
protected TarHeader |
succHeader
The TarHeader to write after this one |
protected int |
uid
|
static int |
UID_SIZE
|
protected java.lang.String |
uname
|
static int |
UNAME_SIZE
|
protected java.lang.String |
version
|
| Constructor Summary | |
|---|---|
TarHeader()
|
|
| Method Summary | ||
|---|---|---|
java.nio.ByteBuffer |
allocateTarHeader()
Allocate a ByteBuffer capable of containing this header |
|
protected
|
chain()
|
|
protected void |
checksum(java.nio.ByteBuffer buffer,
int start,
int end,
int cpos)
Add the checksum |
|
void |
get(java.nio.ByteBuffer buffer)
|
|
protected int |
getAdditionalSize()
Subclasses must implement this if they override the putAdditional(java.nio.ByteBuffer) method. |
|
static int |
getBlockSize(int size)
Returns the size padded out to fit a block |
|
TarHeader |
getPrevHeader()
|
|
TarHeader |
getSuccHeader()
|
|
int |
getTarHeaderSize()
The size this TarHeader requires. |
|
abstract TarHeaderType |
getTarHeaderType()
The TarHeaderType of this instance |
|
void |
put(java.nio.ByteBuffer buffer)
Write the header to the ByteBuffer |
|
protected void |
putAdditional(java.nio.ByteBuffer buffer)
Subclasses can use this to write additional data after the header |
|
void |
setPrevHeader(TarHeader prevHeader)
|
|
void |
setSuccHeader(TarHeader succHeader)
|
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int BLOCK_SIZE
public static final int NAME_SIZE
public static final int MODE_SIZE
public static final int UID_SIZE
public static final int GID_SIZE
public static final int SIZE_SIZE
public static final int MTIME_SIZE
public static final int CHKSUM_SIZE
public static final int LINKNAME_SIZE
public static final int UNAME_SIZE
public static final int GNAME_SIZE
public static final int DEVMAJOR_SIZE
public static final int DEVMINOR_SIZE
public static final int PREFIX_SIZE
protected java.lang.String name
protected int mode
protected int uid
protected int gid
protected long size
protected long mtime
protected java.lang.String chksum
protected java.lang.String version
protected java.lang.String linkname
protected java.lang.String uname
protected java.lang.String gname
protected int devmajor
protected int devminor
protected java.lang.String prefix
protected TarHeader prevHeader
protected TarHeader succHeader
| Constructor Detail |
|---|
public TarHeader()
| Method Detail |
|---|
public abstract TarHeaderType getTarHeaderType()
TarHeaderType of this instance
TarHeaderType of this instancepublic void get(java.nio.ByteBuffer buffer)
public void put(java.nio.ByteBuffer buffer)
ByteBuffer
buffer - ByteBuffer to write to
protected final void checksum(java.nio.ByteBuffer buffer,
int start,
int end,
int cpos)
buffer - ByteBufferstart - initial positionend - end position (exclusive)cpos - position to write the checksumpublic final TarHeader getPrevHeader()
public final void setPrevHeader(TarHeader prevHeader)
public final TarHeader getSuccHeader()
public final void setSuccHeader(TarHeader succHeader)
protected void putAdditional(java.nio.ByteBuffer buffer)
buffer - protected int getAdditionalSize()
putAdditional(java.nio.ByteBuffer) method. It must return
the number of bytes that method would write.
public static int getBlockSize(int size)
size -
public int getTarHeaderSize()
BLOCK_SIZE. If this header has another header attached to it
then it's size is also included.
public java.nio.ByteBuffer allocateTarHeader()
protected final <T extends TarHeader.FileHeader> T chain()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||