Fingerprint_Card
Loading...
Searching...
No Matches
ICSharpCode.SharpZipLib.Zip.ZipExtraData Class Referencesealed

A class to handle the extra data field for Zip entries. More...

Inheritance diagram for ICSharpCode.SharpZipLib.Zip.ZipExtraData:
Collaboration diagram for ICSharpCode.SharpZipLib.Zip.ZipExtraData:

Public Member Functions

 ZipExtraData ()
 Initialise a default instance.
 ZipExtraData (byte[] data)
 Initialise with known extra data.
byte[] GetEntryData ()
 Get the raw extra data value.
void Clear ()
 Clear the stored data.
Stream GetStreamForTag (int tag)
 Get a read-only Stream for the associated tag.
bool Find (int headerID)
 Find an extra data value.
void AddEntry (ITaggedData taggedData)
 Add a new entry to extra data.
void AddEntry (int headerID, byte[] fieldData)
 Add a new entry to extra data.
void StartNewEntry ()
 Start adding a new entry.
void AddNewEntry (int headerID)
 Add entry data added since StartNewEntry using the ID passed.
void AddData (byte data)
 Add a byte of data to the pending new entry.
void AddData (byte[] data)
 Add data to a pending new entry.
void AddLeShort (int toAdd)
 Add a short value in little endian order to the pending new entry.
void AddLeInt (int toAdd)
 Add an integer value in little endian order to the pending new entry.
void AddLeLong (long toAdd)
 Add a long value in little endian order to the pending new entry.
bool Delete (int headerID)
 Delete an extra data field.
long ReadLong ()
 Read a long in little endian form from the last found data value.
int ReadInt ()
 Read an integer in little endian form from the last found data value.
int ReadShort ()
 Read a short value in little endian form from the last found data value.
int ReadByte ()
 Read a byte from an extra data.
void Skip (int amount)
 Skip data during reading.
void Dispose ()
 Dispose of this instance.

Properties

int Length [get]
 Gets the current extra data length.
int ValueLength [get]
 Get the length of the last value found by Find
int CurrentReadIndex [get]
 Get the index for the current read value.
int UnreadCount [get]
 Get the number of bytes remaining to be read for the current value;.

Private Member Functions

ITaggedData GetData (short tag)
 Get the tagged data for a tag.
void ReadCheck (int length)
int ReadShortInternal ()
 Internal form of ReadShort that reads data at any location.
void SetShort (ref int index, int source)

Static Private Member Functions

static ITaggedData Create (short tag, byte[] data, int offset, int count)

Private Attributes

int _index
int _readValueStart
int _readValueLength
MemoryStream _newEntry
byte[] _data

Detailed Description

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.

Constructor & Destructor Documentation

◆ ZipExtraData() [1/2]

ICSharpCode.SharpZipLib.Zip.ZipExtraData.ZipExtraData ( )

Initialise a default instance.

Here is the call graph for this function:

◆ ZipExtraData() [2/2]

ICSharpCode.SharpZipLib.Zip.ZipExtraData.ZipExtraData ( byte[] data)

Initialise with known extra data.

Parameters
dataThe extra data.

Member Function Documentation

◆ AddData() [1/2]

void ICSharpCode.SharpZipLib.Zip.ZipExtraData.AddData ( byte data)

Add a byte of data to the pending new entry.

Parameters
dataThe byte to add.
See also
StartNewEntry
Here is the caller graph for this function:

◆ AddData() [2/2]

void ICSharpCode.SharpZipLib.Zip.ZipExtraData.AddData ( byte[] data)

Add data to a pending new entry.

Parameters
dataThe data to add.
See also
StartNewEntry

◆ AddEntry() [1/2]

void ICSharpCode.SharpZipLib.Zip.ZipExtraData.AddEntry ( int headerID,
byte[] fieldData )

Add a new entry to extra data.

Parameters
headerIDThe ID for this entry.
fieldDataThe data to add.

If the ID already exists its contents are replaced.

Here is the call graph for this function:

◆ AddEntry() [2/2]

void ICSharpCode.SharpZipLib.Zip.ZipExtraData.AddEntry ( ITaggedData taggedData)

Add a new entry to extra data.

Parameters
taggedDataThe ITaggedData value to add.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ AddLeInt()

void ICSharpCode.SharpZipLib.Zip.ZipExtraData.AddLeInt ( int toAdd)

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

Parameters
toAddThe data to add.
See also
StartNewEntry
Here is the call graph for this function:
Here is the caller graph for this function:

◆ AddLeLong()

void ICSharpCode.SharpZipLib.Zip.ZipExtraData.AddLeLong ( long toAdd)

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

Parameters
toAddThe data to add.
See also
StartNewEntry
Here is the call graph for this function:
Here is the caller graph for this function:

◆ AddLeShort()

void ICSharpCode.SharpZipLib.Zip.ZipExtraData.AddLeShort ( int toAdd)

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

Parameters
toAddThe data to add.
See also
StartNewEntry
Here is the caller graph for this function:

◆ AddNewEntry()

void ICSharpCode.SharpZipLib.Zip.ZipExtraData.AddNewEntry ( int headerID)

Add entry data added since StartNewEntry using the ID passed.

Parameters
headerIDThe identifier to use for this entry.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Clear()

void ICSharpCode.SharpZipLib.Zip.ZipExtraData.Clear ( )

Clear the stored data.

Here is the caller graph for this function:

◆ Create()

ITaggedData ICSharpCode.SharpZipLib.Zip.ZipExtraData.Create ( short tag,
byte[] data,
int offset,
int count )
staticprivate
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Delete()

bool ICSharpCode.SharpZipLib.Zip.ZipExtraData.Delete ( int headerID)

Delete an extra data field.

Parameters
headerIDThe identifier of the field to delete.
Returns
Returns true if the field was found and deleted.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Dispose()

void ICSharpCode.SharpZipLib.Zip.ZipExtraData.Dispose ( )

Dispose of this instance.

◆ Find()

bool ICSharpCode.SharpZipLib.Zip.ZipExtraData.Find ( int headerID)

Find an extra data value.

Parameters
headerIDThe identifier for the value to find.
Returns
Returns true if the value was found; false otherwise.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetData()

ITaggedData ICSharpCode.SharpZipLib.Zip.ZipExtraData.GetData ( short tag)
private

Get the tagged data for a tag.

Parameters
tagThe tag to search for.
Returns
Returns a tagged value or null if none found.
Here is the call graph for this function:

◆ GetEntryData()

byte[] ICSharpCode.SharpZipLib.Zip.ZipExtraData.GetEntryData ( )

Get the raw extra data value.

Returns
Returns the raw byte[] extra data this instance represents.
Here is the caller graph for this function:

◆ GetStreamForTag()

Stream ICSharpCode.SharpZipLib.Zip.ZipExtraData.GetStreamForTag ( int tag)

Get a read-only Stream for the associated tag.

Parameters
tagThe tag to locate data for.
Returns
Returns a Stream containing tag data or null if no tag was found.
Here is the call graph for this function:

◆ ReadByte()

int ICSharpCode.SharpZipLib.Zip.ZipExtraData.ReadByte ( )

Read a byte from an extra data.

Returns
The byte value read or -1 if the end of data has been reached.
Here is the caller graph for this function:

◆ ReadCheck()

void ICSharpCode.SharpZipLib.Zip.ZipExtraData.ReadCheck ( int length)
private
Here is the caller graph for this function:

◆ ReadInt()

int ICSharpCode.SharpZipLib.Zip.ZipExtraData.ReadInt ( )

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

Returns
Returns the integer read.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ReadLong()

long ICSharpCode.SharpZipLib.Zip.ZipExtraData.ReadLong ( )

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

Returns
Returns the long value read.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ReadShort()

int ICSharpCode.SharpZipLib.Zip.ZipExtraData.ReadShort ( )

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

Returns
Returns the short value read.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ReadShortInternal()

int ICSharpCode.SharpZipLib.Zip.ZipExtraData.ReadShortInternal ( )
private

Internal form of ReadShort that reads data at any location.

Returns
Returns the short value read.
Here is the caller graph for this function:

◆ SetShort()

void ICSharpCode.SharpZipLib.Zip.ZipExtraData.SetShort ( ref int index,
int source )
private
Here is the caller graph for this function:

◆ Skip()

void ICSharpCode.SharpZipLib.Zip.ZipExtraData.Skip ( int amount)

Skip data during reading.

Parameters
amountThe number of bytes to skip.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ StartNewEntry()

void ICSharpCode.SharpZipLib.Zip.ZipExtraData.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

See also
AddEntry(ITaggedData)
Here is the caller graph for this function:

Member Data Documentation

◆ _data

byte [] ICSharpCode.SharpZipLib.Zip.ZipExtraData._data
private

◆ _index

int ICSharpCode.SharpZipLib.Zip.ZipExtraData._index
private

◆ _newEntry

MemoryStream ICSharpCode.SharpZipLib.Zip.ZipExtraData._newEntry
private

◆ _readValueLength

int ICSharpCode.SharpZipLib.Zip.ZipExtraData._readValueLength
private

◆ _readValueStart

int ICSharpCode.SharpZipLib.Zip.ZipExtraData._readValueStart
private

Property Documentation

◆ CurrentReadIndex

int ICSharpCode.SharpZipLib.Zip.ZipExtraData.CurrentReadIndex
get

Get the index for the current read value.

This is only valid if Find has previously returned true. Initially the result will be the index of the first byte of actual data. The value is updated after calls to ReadInt, ReadShort and ReadLong.

◆ Length

int ICSharpCode.SharpZipLib.Zip.ZipExtraData.Length
get

Gets the current extra data length.

◆ UnreadCount

int ICSharpCode.SharpZipLib.Zip.ZipExtraData.UnreadCount
get

Get the number of bytes remaining to be read for the current value;.

◆ ValueLength

int ICSharpCode.SharpZipLib.Zip.ZipExtraData.ValueLength
get

Get the length of the last value found by Find

This is only valid if Find has previously returned true.


The documentation for this class was generated from the following file: