This class assists with writing/reading from Zip files.
More...
|
| | 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.
|
This class assists with writing/reading from Zip files.
◆ ZipHelperStream() [1/2]
| ICSharpCode.SharpZipLib.Zip.ZipHelperStream.ZipHelperStream |
( |
string | name | ) |
|
Initialise an instance of this class.
- Parameters
-
| name | The name of the file to open. |
◆ ZipHelperStream() [2/2]
| ICSharpCode.SharpZipLib.Zip.ZipHelperStream.ZipHelperStream |
( |
Stream | stream | ) |
|
◆ 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
-
| signature | The signature to find. |
| endLocation | Location, marking the end of block. |
| minimumBlockSize | Minimum size of the block. |
| maximumVariableData | The maximum variable data. |
- Returns
- Eeturns the offset of the first byte after the signature; -1 if not found
◆ 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
-
| zip64 | if set to true [zip64]. |
| data | The data to fill in. |
- Returns
- Returns the number of bytes read in the descriptor.
◆ ReadLEInt()
| int ICSharpCode.SharpZipLib.Zip.ZipHelperStream.ReadLEInt |
( |
| ) |
|
Read an int in little endian byte order.
- Returns
- Returns the value read.
- Exceptions
-
| IOException | An i/o error occurs. |
| System.IO.EndOfStreamException | The file ends prematurely |
◆ ReadLELong()
| long ICSharpCode.SharpZipLib.Zip.ZipHelperStream.ReadLELong |
( |
| ) |
|
Read a long in little endian byte order.
- Returns
- The value read.
◆ ReadLEShort()
| int ICSharpCode.SharpZipLib.Zip.ZipHelperStream.ReadLEShort |
( |
| ) |
|
Read an unsigned short in little endian byte order.
- Returns
- Returns the value read.
- Exceptions
-
| IOException | An i/o error occurs. |
| EndOfStreamException | The file ends prematurely |
◆ Seek()
| override long ICSharpCode.SharpZipLib.Zip.ZipHelperStream.Seek |
( |
long | offset, |
|
|
SeekOrigin | origin ) |
◆ SetLength()
| override void ICSharpCode.SharpZipLib.Zip.ZipHelperStream.SetLength |
( |
long | value | ) |
|
◆ Write()
| override void ICSharpCode.SharpZipLib.Zip.ZipHelperStream.Write |
( |
byte[] | buffer, |
|
|
int | offset, |
|
|
int | count ) |
◆ WriteDataDescriptor()
| int ICSharpCode.SharpZipLib.Zip.ZipHelperStream.WriteDataDescriptor |
( |
ZipEntry | entry | ) |
|
Write a data descriptor.
- Parameters
-
| entry | The entry to write a descriptor for. |
- Returns
- Returns the number of descriptor bytes written.
◆ 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
-
| noOfEntries | The number of entries in the directory. |
| sizeEntries | The size of the entries in the directory. |
| startOfCentralDirectory | The start of the central directory. |
| comment | The archive comment. (This can be null). |
◆ WriteLEInt()
| void ICSharpCode.SharpZipLib.Zip.ZipHelperStream.WriteLEInt |
( |
int | value | ) |
|
Write an int in little endian byte order.
- Parameters
-
◆ WriteLELong()
| void ICSharpCode.SharpZipLib.Zip.ZipHelperStream.WriteLELong |
( |
long | value | ) |
|
Write a long in little endian byte order.
- Parameters
-
◆ WriteLEShort()
| void ICSharpCode.SharpZipLib.Zip.ZipHelperStream.WriteLEShort |
( |
int | value | ) |
|
Write an unsigned short in little endian byte order.
- Parameters
-
◆ WriteLEUint()
| void ICSharpCode.SharpZipLib.Zip.ZipHelperStream.WriteLEUint |
( |
uint | value | ) |
|
Write a uint in little endian byte order.
- Parameters
-
◆ WriteLEUlong()
| void ICSharpCode.SharpZipLib.Zip.ZipHelperStream.WriteLEUlong |
( |
ulong | value | ) |
|
Write a ulong in little endian byte order.
- Parameters
-
◆ WriteLEUshort()
| void ICSharpCode.SharpZipLib.Zip.ZipHelperStream.WriteLEUshort |
( |
ushort | value | ) |
|
Write a ushort in little endian byte order.
- Parameters
-
◆ WriteLocalHeader()
| void ICSharpCode.SharpZipLib.Zip.ZipHelperStream.WriteLocalHeader |
( |
ZipEntry | entry, |
|
|
EntryPatchData | patchData ) |
|
private |
◆ 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
-
| noOfEntries | The number of entries in the central directory. |
| sizeEntries | The size of entries in the central directory. |
| centralDirOffset | The offset of the dentral directory. |
◆ isOwner_
| bool ICSharpCode.SharpZipLib.Zip.ZipHelperStream.isOwner_ |
|
private |
◆ stream_
| Stream ICSharpCode.SharpZipLib.Zip.ZipHelperStream.stream_ |
|
private |
◆ 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: