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
Exibir arquivo Open project: fanfeilong/exceltk Class Usage Examples

Public Methods

Method 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

Method 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 method

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

AddEntry() public method

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

AddEntry() public method

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.
return void

AddLeInt() public method

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

AddLeLong() public method

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

AddLeShort() public method

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

AddNewEntry() public method

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

Clear() public method

Clear the stored data.
public Clear ( ) : void
return void

Delete() public method

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

Dispose() public method

Dispose of this instance.
public Dispose ( ) : void
return void

Find() public method

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

GetEntryData() public method

Get the raw extra data value
public GetEntryData ( ) : byte[]
return byte[]

GetStreamForTag() public method

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

ReadByte() public method

Read a byte from an extra data
public ReadByte ( ) : int
return int

ReadInt() public method

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

ReadLong() public method

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

ReadShort() public method

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

Skip() public method

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

StartNewEntry() public method

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
return void

ZipExtraData() public method

Initialise a default instance.
public ZipExtraData ( ) : System
return System

ZipExtraData() public method

Initialise with known extra data.
public ZipExtraData ( byte data ) : System
data byte The extra data.
return System