C# Class ICSharpCode.SharpZipLib.Zip.ZipHelperStream

This class assists with writing/reading from Zip files.
Inheritance: Stream
显示文件 Open project: icsharpcode/SharpZipLib Class Usage Examples

Public Methods

Method 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.

Protected Methods

Method Description
Dispose ( bool disposing ) : void

Close the stream.

The underlying stream is closed only if IsStreamOwner is true.

Private Methods

Method Description
WriteLocalHeader ( ZipEntry entry, EntryPatchData patchData ) : void

Method Details

Dispose() protected method

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

Flush() public method

public Flush ( ) : void
return void

LocateBlockWithSignature() public method

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.
return long

Read() public method

public Read ( byte buffer, int offset, int count ) : int
buffer byte
offset int
count int
return int

ReadDataDescriptor() public method

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.
return void

ReadLEInt() public method

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

ReadLELong() public method

Read a long in little endian byte order.
public ReadLELong ( ) : long
return long

ReadLEShort() public method

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

Seek() public method

public Seek ( long offset, SeekOrigin origin ) : long
offset long
origin SeekOrigin
return long

SetLength() public method

public SetLength ( long value ) : void
value long
return void

Write() public method

public Write ( byte buffer, int offset, int count ) : void
buffer byte
offset int
count int
return void

WriteDataDescriptor() public method

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

WriteEndOfCentralDirectory() public method

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).
return void

WriteLEInt() public method

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

WriteLELong() public method

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

WriteLEShort() public method

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

WriteLEUint() public method

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

WriteLEUlong() public method

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

WriteLEUshort() public method

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

WriteZip64EndOfCentralDirectory() public method

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.
return void

ZipHelperStream() public method

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

ZipHelperStream() public method

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