Fingerprint_Card
Loading...
Searching...
No Matches
ICSharpCode.SharpZipLib.GZip.GZipInputStream Class Reference

This filter stream is used to decompress a "GZIP" format stream. The "GZIP" format is described baseInputStream RFC 1952. More...

Inheritance diagram for ICSharpCode.SharpZipLib.GZip.GZipInputStream:
Collaboration diagram for ICSharpCode.SharpZipLib.GZip.GZipInputStream:

Public Member Functions

 GZipInputStream (Stream baseInputStream)
 Creates a GZipInputStream with the default buffer size.
 GZipInputStream (Stream baseInputStream, int size)
 Creates a GZIPInputStream with the specified buffer size.
override int Read (byte[] buffer, int offset, int count)
 Reads uncompressed data into an array of bytes.
Public Member Functions inherited from ICSharpCode.SharpZipLib.Zip.Compression.Streams.InflaterInputStream
 InflaterInputStream (Stream baseInputStream)
 Create an InflaterInputStream with the default decompressor and a default buffer size of 4KB.
 InflaterInputStream (Stream baseInputStream, Inflater inf)
 Create an InflaterInputStream with the specified decompressor and a default buffer size of 4KB.
 InflaterInputStream (Stream baseInputStream, Inflater inflater, int bufferSize)
 Create an InflaterInputStream with the specified decompressor and the specified buffer size.
long Skip (long count)
 Skip specified number of bytes of uncompressed data.
override void Flush ()
 Flushes the baseInputStream.
override long Seek (long offset, SeekOrigin origin)
 Sets the position within the current stream Always throws a NotSupportedException.
override void SetLength (long value)
 Set the length of the current stream Always throws a NotSupportedException.
override void Write (byte[] buffer, int offset, int count)
 Writes a sequence of bytes to stream and advances the current position This method always throws a NotSupportedException.
override void WriteByte (byte value)
 Writes one byte to the current stream and advances the current position Always throws a NotSupportedException.
override IAsyncResult BeginWrite (byte[] buffer, int offset, int count, AsyncCallback callback, object state)
 Entry point to begin an asynchronous write. Always throws a NotSupportedException.
override void Close ()
 Closes the input stream. When IsStreamOwner is true the underlying stream is also closed.
override int Read (byte[] buffer, int offset, int count)
 Reads decompressed data into the provided buffer byte array.

Protected Attributes

Crc32 crc
 CRC-32 value for uncompressed data.
Protected Attributes inherited from ICSharpCode.SharpZipLib.Zip.Compression.Streams.InflaterInputStream
Inflater inf
 Decompressor for this stream.
InflaterInputBuffer inputBuffer
 Input buffer for this stream.
long csize
 The compressed size.

Private Member Functions

bool ReadHeader ()
void ReadFooter ()

Private Attributes

bool readGZIPHeader
 Flag to indicate if we've read the GZIP header yet for the current member (block of compressed data). This is tracked per-block as the file is parsed.

Additional Inherited Members

Protected Member Functions inherited from ICSharpCode.SharpZipLib.Zip.Compression.Streams.InflaterInputStream
void StopDecrypting ()
 Clear any cryptographic state.
void Fill ()
 Fills the buffer with more data to decompress.
Properties inherited from ICSharpCode.SharpZipLib.Zip.Compression.Streams.InflaterInputStream
bool IsStreamOwner [get, set]
 Get/set flag indicating ownership of underlying stream. When the flag is true Close will close the underlying stream also.
virtual int Available [get]
 Returns 0 once the end of the stream (EOF) has been reached. Otherwise returns 1.
override bool CanRead [get]
 Gets a value indicating whether the current stream supports reading.
override bool CanSeek [get]
 Gets a value of false indicating seeking is not supported for this stream.
override bool CanWrite [get]
 Gets a value of false indicating that this stream is not writeable.
override long Length [get]
 A value representing the length of the stream in bytes.
override long Position [get, set]
 The current position within the stream. Throws a NotSupportedException when attempting to set the position.

Detailed Description

This filter stream is used to decompress a "GZIP" format stream. The "GZIP" format is described baseInputStream RFC 1952.

author of the original java version : John Leuner

This sample shows how to unzip a gzipped file

using System;
using System.IO;
class MainClass
{
public static void Main(string[] args)
{
using (Stream inStream = new GZipInputStream(File.OpenRead(args[0])))
using (FileStream outStream = File.Create(Path.GetFileNameWithoutExtension(args[0]))) {
byte[] buffer = new byte[4096];
StreamUtils.Copy(inStream, outStream, buffer);
}
}
} <br>
Zwipe.Test.Tools.Entities.File File
Definition ExportsTest.cs:6
Provides simple Stream" utilities.
Definition StreamUtils.cs:45
static void Copy(Stream source, Stream destination, byte[] buffer)
Copy the contents of one Stream to another.
Definition StreamUtils.cs:102
GZipInputStream(Stream baseInputStream)
Creates a GZipInputStream with the default buffer size.
Definition GzipInputStream.cs:101
Definition FileSystemScanner.cs:40
Definition GZIPConstants.cs:40

Constructor & Destructor Documentation

◆ GZipInputStream() [1/2]

ICSharpCode.SharpZipLib.GZip.GZipInputStream.GZipInputStream ( Stream baseInputStream)

Creates a GZipInputStream with the default buffer size.

Parameters
baseInputStreamThe stream to read compressed data from (baseInputStream GZIP format)

◆ GZipInputStream() [2/2]

ICSharpCode.SharpZipLib.GZip.GZipInputStream.GZipInputStream ( Stream baseInputStream,
int size )

Creates a GZIPInputStream with the specified buffer size.

Parameters
baseInputStreamThe stream to read compressed data from (baseInputStream GZIP format)
sizeSize of the buffer to use

Member Function Documentation

◆ Read()

override int ICSharpCode.SharpZipLib.GZip.GZipInputStream.Read ( byte[] buffer,
int offset,
int count )

Reads uncompressed data into an array of bytes.

Parameters
bufferThe buffer to read uncompressed data into
offsetThe offset indicating where the data should be placed
countThe number of uncompressed bytes to be read
Returns
Returns the number of bytes actually read.
Here is the call graph for this function:

◆ ReadFooter()

void ICSharpCode.SharpZipLib.GZip.GZipInputStream.ReadFooter ( )
private
Here is the caller graph for this function:

◆ ReadHeader()

bool ICSharpCode.SharpZipLib.GZip.GZipInputStream.ReadHeader ( )
private
Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ crc

Crc32 ICSharpCode.SharpZipLib.GZip.GZipInputStream.crc
protected

CRC-32 value for uncompressed data.

◆ readGZIPHeader

bool ICSharpCode.SharpZipLib.GZip.GZipInputStream.readGZIPHeader
private

Flag to indicate if we've read the GZIP header yet for the current member (block of compressed data). This is tracked per-block as the file is parsed.


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