This class represents an entry in an Ar archive. It consists
of the entry's header, as well as the entry's File. Entries
can be instantiated in one of three ways, depending on how
they are to be used.
ArEntries that are created from the header bytes read from
an archive are instantiated with the ArEntry( byte[] )
constructor. These entries will be used when extracting from
or listing the contents of an archive. These entries have their
header filled in using the header bytes. They also set the File
to null, since they reference an archive entry not a file.
ArEntries that are created from Files that are to be written
into an archive are instantiated with the ArEntry( File )
constructor. These entries have their header filled in using
the File's information. They also keep a reference to the File
for convenience when writing entries.
Finally, ArEntries can be constructed from nothing but a name.
This allows the programmer to construct the entry by hand, for
instance when only an InputStream is available for writing to
the archive, and the header information is constructed from
other information. In this case the header fields are set to
defaults and the File is set to null.
The C structure for an Ar Entry's header is:
struct header {
char filename[16];
char filedate[12];
char uid[6];
char gid[6];
char mode[8];
char size[10];
char magic[2];
} header;
|