ICSharpCode.SharpZipLib.Tar

Namespace hierarchy


Classes

ClassDescription
InvalidHeaderException This exception is used to indicate that there is a problem with a TAR archive header.
TarArchive The TarArchive class implements the concept of a tar archive. A tar archive is a series of entries, each of which represents a file system object. Each entry in the archive consists of a header record. Directory entries consist only of the header record, and are followed by entries for the directory's contents. File entries consist of a header record followed by the number of records needed to contain the file's contents. All entries are written on record boundaries. Records are 512 bytes long. TarArchives are instantiated in either read or write mode, based upon whether they are instantiated with an InputStream or an OutputStream. Once instantiated TarArchives read/write mode can not be changed. There is currently no support for random access to tar archives. However, it seems that subclassing TarArchive, and using the TarBuffer.getCurrentRecordNum() and TarBuffer.getCurrentBlockNum() methods, this would be rather trvial.
TarBuffer The TarBuffer class implements the tar archive concept of a buffered input stream. This concept goes back to the days of blocked tape drives and special io devices. In the C# universe, the only real function that this class performs is to ensure that files have the correct "block" size, or other tars will complain.

You should never have a need to access this class directly. TarBuffers are created by Tar IO Streams.

TarEntry This class represents an entry in a Tar 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.

TarEntries that are created from the header bytes read from an archive are instantiated with the TarEntry( 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.

TarEntries that are created from Files that are to be written into an archive are instantiated with the TarEntry( 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, TarEntries 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 a Tar Entry's header is:

            struct header {
            	char	name[NAMSIZ];
            	char	mode[8];
            	char	uid[8];
            	char	gid[8];
            	char	size[12];
            	char	mtime[12];
            	char	chksum[8];
            	char	linkflag;
            	char	linkname[NAMSIZ];
            	char	magic[8];
            	char	uname[TUNMLEN];
            	char	gname[TGNMLEN];
            	char	devmajor[8];
            	char	devminor[8];
            	} header;
            

TarHeader
TarHeader This class encapsulates the Tar Entry Header used in Tar Archives. The class also holds a number of tar constants, used mostly in headers.
TarInputStream The TarInputStream reads a UNIX tar archive as an InputStream. methods are provided to position at each successive entry in the archive, and the read each entry as a normal input stream using read().
TarInputStream.EntryFactoryAdapter
TarOutputStream The TarOutputStream writes a UNIX tar archive as an OutputStream. Methods are provided to put entries, and then write their contents by writing to this stream using write().

Interfaces

InterfaceDescription
TarInputStream.IEntryFactory This interface is provided, with the method setEntryFactory(), to allow the programmer to have their own TarEntry subclass instantiated for the entries return from getNextEntry().

Delegates

DelegateDescription
ProgressMessageHandler