public class TarHeader
- Object
- TarHeader
Header
Offset Size Field
0 100 File name
100 8 File mode
108 8 Owner's numeric user ID
116 8 Group's numeric user ID
124 12 File size in bytes
136 12 Last modification time in numeric Unix time format
148 8 Checksum for header block
156 1 Link indicator (file type)
157 100 Name of linked file
File Types
Value Meaning
'0' Normal file
(ASCII NUL) Normal file (now obsolete)
'1' Hard link
'2' Symbolic link
'3' Character special
'4' Block special
'5' Directory
'6' FIFO
'7' Contigous
Ustar header
Offset Size Field
257 6 UStar indicator "ustar"
263 2 UStar version "00"
265 32 Owner user name
297 32 Owner group name
329 8 Device major number
337 8 Device minor number
345 155 Filename prefix
Fields
Constructors
public TarHeader() |
Methods
public static StringBuffer parseName(byte[] header, int offset, int length) | Parse an entry name from a header buffer. |
public static int getNameBytes(StringBuffer name, byte[] buf, int offset, int length) | Determine the number of bytes in an entry name. |
Inherited methods
Field details
NAMELEN
public static final int NAMELEN = 100MODELEN
public static final int MODELEN = 8UIDLEN
public static final int UIDLEN = 8GIDLEN
public static final int GIDLEN = 8SIZELEN
public static final int SIZELEN = 12MODTIMELEN
public static final int MODTIMELEN = 12CHKSUMLEN
public static final int CHKSUMLEN = 8LF_OLDNORM
public static final byte LF_OLDNORM = 0LF_NORMAL
public static final byte LF_NORMAL = 48LF_LINK
public static final byte LF_LINK = 49LF_SYMLINK
public static final byte LF_SYMLINK = 50LF_CHR
public static final byte LF_CHR = 51LF_BLK
public static final byte LF_BLK = 52LF_DIR
public static final byte LF_DIR = 53LF_FIFO
public static final byte LF_FIFO = 54LF_CONTIG
public static final byte LF_CONTIG = 55MAGICLEN
public static final int MAGICLEN = 8TMAGIC
public static final String TMAGIC = "ustar"The magic tag representing a POSIX tar archive.
GNU_TMAGIC
public static final String GNU_TMAGIC = "ustar "The magic tag representing a GNU tar archive.
UNAMELEN
public static final int UNAMELEN = 32GNAMELEN
public static final int GNAMELEN = 32DEVLEN
public static final int DEVLEN = 8name
public StringBuffer namemode
public int modeuserId
public int userIdgroupId
public int groupIdsize
public long sizemodTime
public long modTimecheckSum
public int checkSumlinkFlag
public byte linkFlaglinkName
public StringBuffer linkNamemagic
public StringBuffer magicuserName
public StringBuffer userNamegroupName
public StringBuffer groupNamedevMajor
public int devMajordevMinor
public int devMinorConstructor details
TarHeader
public TarHeader()Method details
parseName
public static StringBuffer parseName(byte[] header, int offset, int length)Parse an entry name from a header buffer.
Parameters
headerbyte[]- The header buffer from which to parse.
offsetint- The offset into the buffer from which to parse.
lengthint- The number of header bytes to parse.
Returns
The header’s entry name.
getNameBytes
public static int getNameBytes(StringBuffer name, byte[] buf, int offset, int length)Determine the number of bytes in an entry name.
Parameters
nameStringBuffer- Not documented.
bufbyte[]- Not documented.
offsetint- The offset into the buffer from which to parse.
lengthint- The number of header bytes to parse.
Returns
The number of bytes in a header’s entry name.