C# Class ICSharpCode.SharpZipLib.Zip.ZipHelperStream

This class assists with writing/reading from Zip files.
Inheritance: Stream
Afficher le fichier Open project: icsharpcode/SharpZipLib Class Usage Examples

Méthodes publiques

Méthode Description
Flush ( ) : void
LocateBlockWithSignature ( int signature, long endLocation, int minimumBlockSize, int maximumVariableData ) : long

Locates a block with the desired signature.

Read ( byte buffer, int offset, int count ) : int
ReadDataDescriptor ( bool zip64, DescriptorData data ) : void

Read data descriptor at the end of compressed data.

ReadLEInt ( ) : int

Read an int in little endian byte order.

ReadLELong ( ) : long

Read a long in little endian byte order.

ReadLEShort ( ) : int

Read an unsigned short in little endian byte order.

Seek ( long offset, SeekOrigin origin ) : long
SetLength ( long value ) : void
Write ( byte buffer, int offset, int count ) : void
WriteDataDescriptor ( ZipEntry entry ) : int

Write a data descriptor.

WriteEndOfCentralDirectory ( long noOfEntries, long sizeEntries, long startOfCentralDirectory, byte comment ) : void

Write the required records to end the central directory.

WriteLEInt ( int value ) : void

Write an int in little endian byte order.

WriteLELong ( long value ) : void

Write a long in little endian byte order.

WriteLEShort ( int value ) : void

Write an unsigned short in little endian byte order.

WriteLEUint ( uint value ) : void

Write a uint in little endian byte order.

WriteLEUlong ( ulong value ) : void

Write a ulong in little endian byte order.

WriteLEUshort ( ushort value ) : void

Write a ushort in little endian byte order.

WriteZip64EndOfCentralDirectory ( long noOfEntries, long sizeEntries, long centralDirOffset ) : void

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

ZipHelperStream ( Stream stream ) : System

Initialise a new instance of ZipHelperStream.

ZipHelperStream ( string name ) : System

Initialise an instance of this class.

Méthodes protégées

Méthode Description
Dispose ( bool disposing ) : void

Close the stream.

The underlying stream is closed only if IsStreamOwner is true.

Private Methods

Méthode Description
WriteLocalHeader ( ZipEntry entry, EntryPatchData patchData ) : void

Method Details

Dispose() protected méthode

Close the stream.
The underlying stream is closed only if IsStreamOwner is true.
protected Dispose ( bool disposing ) : void
disposing bool
Résultat void

Flush() public méthode

public Flush ( ) : void
Résultat void

LocateBlockWithSignature() public méthode

Locates a block with the desired signature.
public LocateBlockWithSignature ( int signature, long endLocation, int minimumBlockSize, int maximumVariableData ) : long
signature int The signature to find.
endLocation long Location, marking the end of block.
minimumBlockSize int Minimum size of the block.
maximumVariableData int The maximum variable data.
Résultat long

Read() public méthode

public Read ( byte buffer, int offset, int count ) : int
buffer byte
offset int
count int
Résultat int

ReadDataDescriptor() public méthode

Read data descriptor at the end of compressed data.
public ReadDataDescriptor ( bool zip64, DescriptorData data ) : void
zip64 bool if set to true [zip64].
data DescriptorData The data to fill in.
Résultat void

ReadLEInt() public méthode

Read an int in little endian byte order.
/// An i/o error occurs. /// /// The file ends prematurely ///
public ReadLEInt ( ) : int
Résultat int

ReadLELong() public méthode

Read a long in little endian byte order.
public ReadLELong ( ) : long
Résultat long

ReadLEShort() public méthode

Read an unsigned short in little endian byte order.
/// An i/o error occurs. /// /// The file ends prematurely ///
public ReadLEShort ( ) : int
Résultat int

Seek() public méthode

public Seek ( long offset, SeekOrigin origin ) : long
offset long
origin SeekOrigin
Résultat long

SetLength() public méthode

public SetLength ( long value ) : void
value long
Résultat void

Write() public méthode

public Write ( byte buffer, int offset, int count ) : void
buffer byte
offset int
count int
Résultat void

WriteDataDescriptor() public méthode

Write a data descriptor.
public WriteDataDescriptor ( ZipEntry entry ) : int
entry ZipEntry The entry to write a descriptor for.
Résultat int

WriteEndOfCentralDirectory() public méthode

Write the required records to end the central directory.
public WriteEndOfCentralDirectory ( long noOfEntries, long sizeEntries, long startOfCentralDirectory, byte comment ) : void
noOfEntries long The number of entries in the directory.
sizeEntries long The size of the entries in the directory.
startOfCentralDirectory long The start of the central directory.
comment byte The archive comment. (This can be null).
Résultat void

WriteLEInt() public méthode

Write an int in little endian byte order.
public WriteLEInt ( int value ) : void
value int The value to write.
Résultat void

WriteLELong() public méthode

Write a long in little endian byte order.
public WriteLELong ( long value ) : void
value long The value to write.
Résultat void

WriteLEShort() public méthode

Write an unsigned short in little endian byte order.
public WriteLEShort ( int value ) : void
value int The value to write.
Résultat void

WriteLEUint() public méthode

Write a uint in little endian byte order.
public WriteLEUint ( uint value ) : void
value uint The value to write.
Résultat void

WriteLEUlong() public méthode

Write a ulong in little endian byte order.
public WriteLEUlong ( ulong value ) : void
value ulong The value to write.
Résultat void

WriteLEUshort() public méthode

Write a ushort in little endian byte order.
public WriteLEUshort ( ushort value ) : void
value ushort The value to write.
Résultat void

WriteZip64EndOfCentralDirectory() public méthode

Write Zip64 end of central directory records (File header and locator).
public WriteZip64EndOfCentralDirectory ( long noOfEntries, long sizeEntries, long centralDirOffset ) : void
noOfEntries long The number of entries in the central directory.
sizeEntries long The size of entries in the central directory.
centralDirOffset long The offset of the dentral directory.
Résultat void

ZipHelperStream() public méthode

Initialise a new instance of ZipHelperStream.
public ZipHelperStream ( Stream stream ) : System
stream Stream The stream to use.
Résultat System

ZipHelperStream() public méthode

Initialise an instance of this class.
public ZipHelperStream ( string name ) : System
name string The name of the file to open.
Résultat System