# Class TarHeader

java.lang.Object
com.codename1.io.tar.TarHeader

public class TarHeader extends Object

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

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `int`
  `checkSum`
  `static final int`
  `CHKSUMLEN`
  `static final int`
  `DEVLEN`
  `int`
  `devMajor`
  `int`
  `devMinor`
  `static final int`
  `GIDLEN`
  `static final int`
  `GNAMELEN`
  `static final String`
  `GNU_TMAGIC`
  The magic tag representing a GNU tar archive.
  `int`
  `groupId`
  `StringBuffer`
  `groupName`
  `static final byte`
  `LF_BLK`
  `static final byte`
  `LF_CHR`
  `static final byte`
  `LF_CONTIG`
  `static final byte`
  `LF_DIR`
  `static final byte`
  `LF_FIFO`
  `static final byte`
  `LF_LINK`
  `static final byte`
  `LF_NORMAL`
  `static final byte`
  `LF_OLDNORM`
  `static final byte`
  `LF_SYMLINK`
  `byte`
  `linkFlag`
  `StringBuffer`
  `linkName`
  `StringBuffer`
  `magic`
  `static final int`
  `MAGICLEN`
  `int`
  `mode`
  `static final int`
  `MODELEN`
  `long`
  `modTime`
  `static final int`
  `MODTIMELEN`
  `StringBuffer`
  `name`
  `static final int`
  `NAMELEN`
  `long`
  `size`
  `static final int`
  `SIZELEN`
  `static final String`
  `TMAGIC`
  The magic tag representing a POSIX tar archive.
  `static final int`
  `UIDLEN`
  `static final int`
  `UNAMELEN`
  `int`
  `userId`
  `StringBuffer`
  `userName`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `TarHeader()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `static int`
  `getNameBytes(StringBuffer name, byte[] buf, int offset, int length)`
  Determine the number of bytes in an entry name.
  `static StringBuffer`
  `parseName(byte[] header, int offset, int length)`
  Parse an entry name from a header buffer.

  ### Methods inherited from class Object

  `clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Field Details

  - ### NAMELEN

    public static final int NAMELEN
    See Also:
      - Constant Field Values

  - ### MODELEN

    public static final int MODELEN
    See Also:
      - Constant Field Values

  - ### UIDLEN

    public static final int UIDLEN
    See Also:
      - Constant Field Values

  - ### GIDLEN

    public static final int GIDLEN
    See Also:
      - Constant Field Values

  - ### SIZELEN

    public static final int SIZELEN
    See Also:
      - Constant Field Values

  - ### MODTIMELEN

    public static final int MODTIMELEN
    See Also:
      - Constant Field Values

  - ### CHKSUMLEN

    public static final int CHKSUMLEN
    See Also:
      - Constant Field Values

  - ### LF_OLDNORM

    public static final byte LF_OLDNORM
    See Also:
      - Constant Field Values

  - ### LF_NORMAL

    public static final byte LF_NORMAL
    See Also:
      - Constant Field Values

  - ### LF_LINK

    public static final byte LF_LINK
    See Also:
      - Constant Field Values

  - ### LF_SYMLINK

    public static final byte LF_SYMLINK
    See Also:
      - Constant Field Values

  - ### LF_CHR

    public static final byte LF_CHR
    See Also:
      - Constant Field Values

  - ### LF_BLK

    public static final byte LF_BLK
    See Also:
      - Constant Field Values

  - ### LF_DIR

    public static final byte LF_DIR
    See Also:
      - Constant Field Values

  - ### LF_FIFO

    public static final byte LF_FIFO
    See Also:
      - Constant Field Values

  - ### LF_CONTIG

    public static final byte LF_CONTIG
    See Also:
      - Constant Field Values

  - ### MAGICLEN

    public static final int MAGICLEN
    See Also:
      - Constant Field Values

  - ### TMAGIC

    public static final String TMAGIC
    The magic tag representing a POSIX tar archive.
    See Also:
      - Constant Field Values

  - ### GNU_TMAGIC

    public static final String GNU_TMAGIC
    The magic tag representing a GNU tar archive.
    See Also:
      - Constant Field Values

  - ### UNAMELEN

    public static final int UNAMELEN
    See Also:
      - Constant Field Values

  - ### GNAMELEN

    public static final int GNAMELEN
    See Also:
      - Constant Field Values

  - ### DEVLEN

    public static final int DEVLEN
    See Also:
      - Constant Field Values

  - ### name

    public StringBuffer name

  - ### mode

    public int mode

  - ### userId

    public int userId

  - ### groupId

    public int groupId

  - ### size

    public long size

  - ### modTime

    public long modTime

  - ### checkSum

    public int checkSum

  - ### linkFlag

    public byte linkFlag

  - ### linkName

    public StringBuffer linkName

  - ### magic

    public StringBuffer magic

  - ### userName

    public StringBuffer userName

  - ### groupName

    public StringBuffer groupName

  - ### devMajor

    public int devMajor

  - ### devMinor

    public int devMinor

- ## Constructor 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

    - `name`

    - `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.

    ###### 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

    - `name`

    - `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.

    ###### Returns

    The number of bytes in a header's entry name.