C# Класс 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.
Наследование: ICloneable
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
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.

Приватные методы

Метод Описание
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.

Описание методов

Clone() публичный Метод

Create a new TarHeader that is a copy of the current instance.
public Clone ( ) : object
Результат object

Equals() публичный Метод

Determines if this instance is equal to the specified object.
public Equals ( object obj ) : bool
obj object The object to compare with.
Результат bool

GetAsciiBytes() публичный статический Метод

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.
Результат int

GetHashCode() публичный Метод

Get a hash code for the current object.
public GetHashCode ( ) : int
Результат int

GetNameBytes() публичный статический Метод

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 ///
Результат int

GetNameBytes() публичный статический Метод

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
Результат int

GetNameBytes() публичный статический Метод

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
Результат int

GetNameBytes() публичный статический Метод

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
Результат int

GetOctalBytes() публичный статический Метод

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 ///
Результат int

ParseBuffer() публичный Метод

Parse TarHeader information from a header buffer.
public ParseBuffer ( byte header ) : void
header byte /// The tar entry header buffer to get information from. ///
Результат void

ParseName() публичный статический Метод

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. ///
Результат StringBuilder

ParseOctal() публичный статический Метод

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.
Результат long

TarHeader() публичный Метод

Initialise a default TarHeader instance
public TarHeader ( ) : System
Результат System

WriteHeader() публичный Метод

'Write' header information to buffer provided, updating the check sum.
public WriteHeader ( byte outBuffer ) : void
outBuffer byte output buffer for header information
Результат void