Fingerprint_Card
Loading...
Searching...
No Matches
ICSharpCode.SharpZipLib.Zip.ZipHelperStream Class Reference

This class assists with writing/reading from Zip files. More...

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

Public Member Functions

 ZipHelperStream (string name)
 Initialise an instance of this class.
 ZipHelperStream (Stream stream)
 Initialise a new instance of ZipHelperStream.
override void Flush ()
override long Seek (long offset, SeekOrigin origin)
override void SetLength (long value)
override int Read (byte[] buffer, int offset, int count)
override void Write (byte[] buffer, int offset, int count)
override void Close ()
 Close the stream.
long LocateBlockWithSignature (int signature, long endLocation, int minimumBlockSize, int maximumVariableData)
 Locates a block with the desired signature .
void WriteZip64EndOfCentralDirectory (long noOfEntries, long sizeEntries, long centralDirOffset)
 Write Zip64 end of central directory records (File header and locator).
void WriteEndOfCentralDirectory (long noOfEntries, long sizeEntries, long startOfCentralDirectory, byte[] comment)
 Write the required records to end the central directory.
int ReadLEShort ()
 Read an unsigned short in little endian byte order.
int ReadLEInt ()
 Read an int in little endian byte order.
long ReadLELong ()
 Read a long in little endian byte order.
void WriteLEShort (int value)
 Write an unsigned short in little endian byte order.
void WriteLEUshort (ushort value)
 Write a ushort in little endian byte order.
void WriteLEInt (int value)
 Write an int in little endian byte order.
void WriteLEUint (uint value)
 Write a uint in little endian byte order.
void WriteLELong (long value)
 Write a long in little endian byte order.
void WriteLEUlong (ulong value)
 Write a ulong in little endian byte order.
int WriteDataDescriptor (ZipEntry entry)
 Write a data descriptor.
void ReadDataDescriptor (bool zip64, DescriptorData data)
 Read data descriptor at the end of compressed data.

Properties

bool IsStreamOwner [get, set]
 Get / set a value indicating wether the the underlying stream is owned or not.
override bool CanRead [get]
override bool CanSeek [get]
override bool CanTimeout [get]
override long Length [get]
override long Position [get, set]
override bool CanWrite [get]

Private Member Functions

void WriteLocalHeader (ZipEntry entry, EntryPatchData patchData)

Private Attributes

bool isOwner_
Stream stream_

Detailed Description

This class assists with writing/reading from Zip files.

Constructor & Destructor Documentation

◆ ZipHelperStream() [1/2]

ICSharpCode.SharpZipLib.Zip.ZipHelperStream.ZipHelperStream ( string name)

Initialise an instance of this class.

Parameters
nameThe name of the file to open.

◆ ZipHelperStream() [2/2]

ICSharpCode.SharpZipLib.Zip.ZipHelperStream.ZipHelperStream ( Stream stream)

Initialise a new instance of ZipHelperStream.

Parameters
streamThe stream to use.

Member Function Documentation

◆ Close()

override void ICSharpCode.SharpZipLib.Zip.ZipHelperStream.Close ( )

Close the stream.

The underlying stream is closed only if IsStreamOwner is true.

◆ Flush()

override void ICSharpCode.SharpZipLib.Zip.ZipHelperStream.Flush ( )

◆ LocateBlockWithSignature()

long ICSharpCode.SharpZipLib.Zip.ZipHelperStream.LocateBlockWithSignature ( int signature,
long endLocation,
int minimumBlockSize,
int maximumVariableData )

Locates a block with the desired signature .

Parameters
signatureThe signature to find.
endLocationLocation, marking the end of block.
minimumBlockSizeMinimum size of the block.
maximumVariableDataThe maximum variable data.
Returns
Eeturns the offset of the first byte after the signature; -1 if not found
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Read()

override int ICSharpCode.SharpZipLib.Zip.ZipHelperStream.Read ( byte[] buffer,
int offset,
int count )

◆ ReadDataDescriptor()

void ICSharpCode.SharpZipLib.Zip.ZipHelperStream.ReadDataDescriptor ( bool zip64,
DescriptorData data )

Read data descriptor at the end of compressed data.

Parameters
zip64if set to true [zip64].
dataThe data to fill in.
Returns
Returns the number of bytes read in the descriptor.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ReadLEInt()

int ICSharpCode.SharpZipLib.Zip.ZipHelperStream.ReadLEInt ( )

Read an int in little endian byte order.

Returns
Returns the value read.
Exceptions
IOExceptionAn i/o error occurs.
System.IO.EndOfStreamExceptionThe file ends prematurely
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ReadLELong()

long ICSharpCode.SharpZipLib.Zip.ZipHelperStream.ReadLELong ( )

Read a long in little endian byte order.

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

◆ ReadLEShort()

int ICSharpCode.SharpZipLib.Zip.ZipHelperStream.ReadLEShort ( )

Read an unsigned short in little endian byte order.

Returns
Returns the value read.
Exceptions
IOExceptionAn i/o error occurs.
EndOfStreamExceptionThe file ends prematurely
Here is the caller graph for this function:

◆ Seek()

override long ICSharpCode.SharpZipLib.Zip.ZipHelperStream.Seek ( long offset,
SeekOrigin origin )
Here is the caller graph for this function:

◆ SetLength()

override void ICSharpCode.SharpZipLib.Zip.ZipHelperStream.SetLength ( long value)
Here is the caller graph for this function:

◆ Write()

override void ICSharpCode.SharpZipLib.Zip.ZipHelperStream.Write ( byte[] buffer,
int offset,
int count )
Here is the caller graph for this function:

◆ WriteDataDescriptor()

int ICSharpCode.SharpZipLib.Zip.ZipHelperStream.WriteDataDescriptor ( ZipEntry entry)

Write a data descriptor.

Parameters
entryThe entry to write a descriptor for.
Returns
Returns the number of descriptor bytes written.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ WriteEndOfCentralDirectory()

void ICSharpCode.SharpZipLib.Zip.ZipHelperStream.WriteEndOfCentralDirectory ( long noOfEntries,
long sizeEntries,
long startOfCentralDirectory,
byte[] comment )

Write the required records to end the central directory.

Parameters
noOfEntriesThe number of entries in the directory.
sizeEntriesThe size of the entries in the directory.
startOfCentralDirectoryThe start of the central directory.
commentThe archive comment. (This can be null).
Here is the call graph for this function:
Here is the caller graph for this function:

◆ WriteLEInt()

void ICSharpCode.SharpZipLib.Zip.ZipHelperStream.WriteLEInt ( int value)

Write an int in little endian byte order.

Parameters
valueThe value to write.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ WriteLELong()

void ICSharpCode.SharpZipLib.Zip.ZipHelperStream.WriteLELong ( long value)

Write a long in little endian byte order.

Parameters
valueThe value to write.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ WriteLEShort()

void ICSharpCode.SharpZipLib.Zip.ZipHelperStream.WriteLEShort ( int value)

Write an unsigned short in little endian byte order.

Parameters
valueThe value to write.
Here is the caller graph for this function:

◆ WriteLEUint()

void ICSharpCode.SharpZipLib.Zip.ZipHelperStream.WriteLEUint ( uint value)

Write a uint in little endian byte order.

Parameters
valueThe value to write.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ WriteLEUlong()

void ICSharpCode.SharpZipLib.Zip.ZipHelperStream.WriteLEUlong ( ulong value)

Write a ulong in little endian byte order.

Parameters
valueThe value to write.
Here is the call graph for this function:

◆ WriteLEUshort()

void ICSharpCode.SharpZipLib.Zip.ZipHelperStream.WriteLEUshort ( ushort value)

Write a ushort in little endian byte order.

Parameters
valueThe value to write.
Here is the caller graph for this function:

◆ WriteLocalHeader()

void ICSharpCode.SharpZipLib.Zip.ZipHelperStream.WriteLocalHeader ( ZipEntry entry,
EntryPatchData patchData )
private
Here is the call graph for this function:

◆ WriteZip64EndOfCentralDirectory()

void ICSharpCode.SharpZipLib.Zip.ZipHelperStream.WriteZip64EndOfCentralDirectory ( long noOfEntries,
long sizeEntries,
long centralDirOffset )

Write Zip64 end of central directory records (File header and locator).

Parameters
noOfEntriesThe number of entries in the central directory.
sizeEntriesThe size of entries in the central directory.
centralDirOffsetThe offset of the dentral directory.
Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ isOwner_

bool ICSharpCode.SharpZipLib.Zip.ZipHelperStream.isOwner_
private

◆ stream_

Stream ICSharpCode.SharpZipLib.Zip.ZipHelperStream.stream_
private

Property Documentation

◆ CanRead

override bool ICSharpCode.SharpZipLib.Zip.ZipHelperStream.CanRead
get

◆ CanSeek

override bool ICSharpCode.SharpZipLib.Zip.ZipHelperStream.CanSeek
get

◆ CanTimeout

override bool ICSharpCode.SharpZipLib.Zip.ZipHelperStream.CanTimeout
get

◆ CanWrite

override bool ICSharpCode.SharpZipLib.Zip.ZipHelperStream.CanWrite
get

◆ IsStreamOwner

bool ICSharpCode.SharpZipLib.Zip.ZipHelperStream.IsStreamOwner
getset

Get / set a value indicating wether the the underlying stream is owned or not.

If the stream is owned it is closed when this instance is closed.

◆ Length

override long ICSharpCode.SharpZipLib.Zip.ZipHelperStream.Length
get

◆ Position

override long ICSharpCode.SharpZipLib.Zip.ZipHelperStream.Position
getset

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