C# Class ICSharpCode.SharpZipLib.Zip.ZipExtraData

A class to handle the extra data field for Zip entries
Extra data contains 0 or more values each prefixed by a header tag and length. They contain zero or more bytes of actual data. The data is held internally using a copy on write strategy. This is more efficient but means that for extra data created by passing in data can have the values modified by the caller in some circumstances.
Inheritance: IDisposable
Afficher le fichier Open project: fanfeilong/exceltk Class Usage Examples

Méthodes publiques

Méthode Description
AddData ( byte data ) : void

Add a byte of data to the pending new entry.

AddEntry ( ITaggedData taggedData ) : void

Add a new entry to extra data.

AddEntry ( int headerID, byte fieldData ) : void

Add a new entry to extra data

If the ID already exists its contents are replaced.

AddLeInt ( int toAdd ) : void

Add an integer value in little endian order to the pending new entry.

AddLeLong ( long toAdd ) : void

Add a long value in little endian order to the pending new entry.

AddLeShort ( int toAdd ) : void

Add a short value in little endian order to the pending new entry.

AddNewEntry ( int headerID ) : void

Add entry data added since StartNewEntry using the ID passed.

Clear ( ) : void

Clear the stored data.

Delete ( int headerID ) : bool

Delete an extra data field.

Dispose ( ) : void

Dispose of this instance.

Find ( int headerID ) : bool

Find an extra data value

GetEntryData ( ) : byte[]

Get the raw extra data value

GetStreamForTag ( int tag ) : Stream

Get a read-only Stream for the associated tag.

ReadByte ( ) : int

Read a byte from an extra data

ReadInt ( ) : int

Read an integer in little endian form from the last found data value.

ReadLong ( ) : long

Read a long in little endian form from the last found data value

ReadShort ( ) : int

Read a short value in little endian form from the last found data value.

Skip ( int amount ) : void

Skip data during reading.

StartNewEntry ( ) : void

Start adding a new entry.

Add data using AddData(byte[]), AddLeShort, AddLeInt, or AddLeLong. The new entry is completed and actually added by calling AddNewEntry

ZipExtraData ( ) : System

Initialise a default instance.

ZipExtraData ( byte data ) : System

Initialise with known extra data.

Private Methods

Méthode Description
Create ( short tag, byte data, int offset, int count ) : ITaggedData
GetData ( short tag ) : ITaggedData

Get the tagged data for a tag.

ReadCheck ( int length ) : void
ReadShortInternal ( ) : int

Internal form of ReadShort that reads data at any location.

SetShort ( int &index, int source ) : void

Method Details

AddData() public méthode

Add a byte of data to the pending new entry.
public AddData ( byte data ) : void
data byte The byte to add.
Résultat void

AddEntry() public méthode

Add a new entry to extra data.
public AddEntry ( ITaggedData taggedData ) : void
taggedData ITaggedData The value to add.
Résultat void

AddEntry() public méthode

Add a new entry to extra data
If the ID already exists its contents are replaced.
public AddEntry ( int headerID, byte fieldData ) : void
headerID int The ID for this entry.
fieldData byte The data to add.
Résultat void

AddLeInt() public méthode

Add an integer value in little endian order to the pending new entry.
public AddLeInt ( int toAdd ) : void
toAdd int The data to add.
Résultat void

AddLeLong() public méthode

Add a long value in little endian order to the pending new entry.
public AddLeLong ( long toAdd ) : void
toAdd long The data to add.
Résultat void

AddLeShort() public méthode

Add a short value in little endian order to the pending new entry.
public AddLeShort ( int toAdd ) : void
toAdd int The data to add.
Résultat void

AddNewEntry() public méthode

Add entry data added since StartNewEntry using the ID passed.
public AddNewEntry ( int headerID ) : void
headerID int The identifier to use for this entry.
Résultat void

Clear() public méthode

Clear the stored data.
public Clear ( ) : void
Résultat void

Delete() public méthode

Delete an extra data field.
public Delete ( int headerID ) : bool
headerID int The identifier of the field to delete.
Résultat bool

Dispose() public méthode

Dispose of this instance.
public Dispose ( ) : void
Résultat void

Find() public méthode

Find an extra data value
public Find ( int headerID ) : bool
headerID int The identifier for the value to find.
Résultat bool

GetEntryData() public méthode

Get the raw extra data value
public GetEntryData ( ) : byte[]
Résultat byte[]

GetStreamForTag() public méthode

Get a read-only Stream for the associated tag.
public GetStreamForTag ( int tag ) : Stream
tag int The tag to locate data for.
Résultat Stream

ReadByte() public méthode

Read a byte from an extra data
public ReadByte ( ) : int
Résultat int

ReadInt() public méthode

Read an integer in little endian form from the last found data value.
public ReadInt ( ) : int
Résultat int

ReadLong() public méthode

Read a long in little endian form from the last found data value
public ReadLong ( ) : long
Résultat long

ReadShort() public méthode

Read a short value in little endian form from the last found data value.
public ReadShort ( ) : int
Résultat int

Skip() public méthode

Skip data during reading.
public Skip ( int amount ) : void
amount int The number of bytes to skip.
Résultat void

StartNewEntry() public méthode

Start adding a new entry.
Add data using AddData(byte[]), AddLeShort, AddLeInt, or AddLeLong. The new entry is completed and actually added by calling AddNewEntry
public StartNewEntry ( ) : void
Résultat void

ZipExtraData() public méthode

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

ZipExtraData() public méthode

Initialise with known extra data.
public ZipExtraData ( byte data ) : System
data byte The extra data.
Résultat System