C# Class ICSharpCode.SharpZipLib.Tar.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.
Inheritance: ICloneable
Afficher le fichier Open project: icsharpcode/SharpZipLib Class Usage Examples

Méthodes publiques

Méthode Description
Clone ( ) : object

Create a new TarHeader that is a copy of the current instance.

Equals ( object obj ) : bool

Determines if this instance is equal to the specified object.

GetAsciiBytes ( string toAdd, int nameOffset, byte buffer, int bufferOffset, int length ) : int

Add a string to a buffer as a collection of ascii bytes.

GetHashCode ( ) : int

Get a hash code for the current object.

GetNameBytes ( StringBuilder name, byte buffer, int offset, int length ) : int

Add an entry name to the buffer

GetNameBytes ( StringBuilder name, int nameOffset, byte buffer, int bufferOffset, int length ) : int

Add name to the buffer as a collection of bytes

GetNameBytes ( string name, byte buffer, int offset, int length ) : int

Add an entry name to the buffer

GetNameBytes ( string name, int nameOffset, byte buffer, int bufferOffset, int length ) : int

Add name to the buffer as a collection of bytes

GetOctalBytes ( long value, byte buffer, int offset, int length ) : int

Put an octal representation of a value into a buffer

ParseBuffer ( byte header ) : void

Parse TarHeader information from a header buffer.

ParseName ( byte header, int offset, int length ) : StringBuilder

Parse a name from a header buffer.

ParseOctal ( byte header, int offset, int length ) : long

Parse an octal string from a header buffer.

TarHeader ( ) : System

Initialise a default TarHeader instance

WriteHeader ( byte outBuffer ) : void

'Write' header information to buffer provided, updating the check sum.

Private Methods

Méthode Description
ComputeCheckSum ( byte buffer ) : int

Compute the checksum for a tar entry header. The checksum field must be all spaces prior to this happening

GetBinaryOrOctalBytes ( long value, byte buffer, int offset, int length ) : int

Put an octal or binary representation of a value into a buffer

GetCTime ( System.DateTime dateTime ) : int
GetCheckSumOctalBytes ( long value, byte buffer, int offset, int length ) : void

Add the checksum integer to header buffer.

GetDateTimeFromCTime ( long ticks ) : System.DateTime
GetName ( ) : string
MakeCheckSum ( byte buffer ) : int

Make a checksum for a tar entry ignoring the checksum contents.

ParseBinaryOrOctal ( byte header, int offset, int length ) : long
RestoreSetValues ( ) : void
SetValueDefaults ( int userId, string userName, int groupId, string groupName ) : void

Set defaults for values used when constructing a TarHeader instance.

Method Details

Clone() public méthode

Create a new TarHeader that is a copy of the current instance.
public Clone ( ) : object
Résultat object

Equals() public méthode

Determines if this instance is equal to the specified object.
public Equals ( object obj ) : bool
obj object The object to compare with.
Résultat bool

GetAsciiBytes() public static méthode

Add a string to a buffer as a collection of ascii bytes.
public static GetAsciiBytes ( string toAdd, int nameOffset, byte buffer, int bufferOffset, int length ) : int
toAdd string The string to add
nameOffset int The offset of the first character to add.
buffer byte The buffer to add to.
bufferOffset int The offset to start adding at.
length int The number of ascii characters to add.
Résultat int

GetHashCode() public méthode

Get a hash code for the current object.
public GetHashCode ( ) : int
Résultat int

GetNameBytes() public static méthode

Add an entry name to the buffer
public static GetNameBytes ( StringBuilder name, byte buffer, int offset, int length ) : int
name StringBuilder /// The name to add ///
buffer byte /// The buffer to add to ///
offset int /// The offset into the buffer from which to start adding ///
length int /// The number of header bytes to add ///
Résultat int

GetNameBytes() public static méthode

Add name to the buffer as a collection of bytes
public static GetNameBytes ( StringBuilder name, int nameOffset, byte buffer, int bufferOffset, int length ) : int
name StringBuilder The name to add
nameOffset int The offset of the first character
buffer byte The buffer to add to
bufferOffset int The index of the first byte to add
length int The number of characters/bytes to add
Résultat int

GetNameBytes() public static méthode

Add an entry name to the buffer
public static GetNameBytes ( string name, byte buffer, int offset, int length ) : int
name string The name to add
buffer byte The buffer to add to
offset int The offset into the buffer from which to start adding
length int The number of header bytes to add
Résultat int

GetNameBytes() public static méthode

Add name to the buffer as a collection of bytes
public static GetNameBytes ( string name, int nameOffset, byte buffer, int bufferOffset, int length ) : int
name string The name to add
nameOffset int The offset of the first character
buffer byte The buffer to add to
bufferOffset int The index of the first byte to add
length int The number of characters/bytes to add
Résultat int

GetOctalBytes() public static méthode

Put an octal representation of a value into a buffer
public static GetOctalBytes ( long value, byte buffer, int offset, int length ) : int
value long /// the value to be converted to octal ///
buffer byte /// buffer to store the octal string ///
offset int /// The offset into the buffer where the value starts ///
length int /// The length of the octal string to create ///
Résultat int

ParseBuffer() public méthode

Parse TarHeader information from a header buffer.
public ParseBuffer ( byte header ) : void
header byte /// The tar entry header buffer to get information from. ///
Résultat void

ParseName() public static méthode

Parse a name from a header buffer.
public static ParseName ( byte header, int offset, int length ) : StringBuilder
header byte /// The header buffer from which to parse. ///
offset int /// The offset into the buffer from which to parse. ///
length int /// The number of header bytes to parse. ///
Résultat StringBuilder

ParseOctal() public static méthode

Parse an octal string from a header buffer.
public static ParseOctal ( byte header, int offset, int length ) : long
header byte The header buffer from which to parse.
offset int The offset into the buffer from which to parse.
length int The number of header bytes to parse.
Résultat long

TarHeader() public méthode

Initialise a default TarHeader instance
public TarHeader ( ) : System
Résultat System

WriteHeader() public méthode

'Write' header information to buffer provided, updating the check sum.
public WriteHeader ( byte outBuffer ) : void
outBuffer byte output buffer for header information
Résultat void