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

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

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

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

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

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

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

Add a byte of data to the pending new entry.
public AddData ( byte data ) : void
data byte The byte to add.
Результат void

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

Add a new entry to extra data.
public AddEntry ( ITaggedData taggedData ) : void
taggedData ITaggedData The value to add.
Результат void

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

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

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

Add an integer value in little endian order to the pending new entry.
public AddLeInt ( int toAdd ) : void
toAdd int The data to add.
Результат void

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

Add a long value in little endian order to the pending new entry.
public AddLeLong ( long toAdd ) : void
toAdd long The data to add.
Результат void

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

Add a short value in little endian order to the pending new entry.
public AddLeShort ( int toAdd ) : void
toAdd int The data to add.
Результат void

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

Add entry data added since StartNewEntry using the ID passed.
public AddNewEntry ( int headerID ) : void
headerID int The identifier to use for this entry.
Результат void

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

Clear the stored data.
public Clear ( ) : void
Результат void

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

Delete an extra data field.
public Delete ( int headerID ) : bool
headerID int The identifier of the field to delete.
Результат bool

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

Dispose of this instance.
public Dispose ( ) : void
Результат void

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

Find an extra data value
public Find ( int headerID ) : bool
headerID int The identifier for the value to find.
Результат bool

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

Get the raw extra data value
public GetEntryData ( ) : byte[]
Результат byte[]

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

Get a read-only Stream for the associated tag.
public GetStreamForTag ( int tag ) : Stream
tag int The tag to locate data for.
Результат Stream

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

Read a byte from an extra data
public ReadByte ( ) : int
Результат int

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

Read an integer in little endian form from the last found data value.
public ReadInt ( ) : int
Результат int

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

Read a long in little endian form from the last found data value
public ReadLong ( ) : long
Результат long

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

Read a short value in little endian form from the last found data value.
public ReadShort ( ) : int
Результат int

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

Skip data during reading.
public Skip ( int amount ) : void
amount int The number of bytes to skip.
Результат void

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

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

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

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

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

Initialise with known extra data.
public ZipExtraData ( byte data ) : System
data byte The extra data.
Результат System