Class InflaterInputStream
This filter stream is used to decompress data compressed using the "deflate" format. The "deflate" format is described in RFC 1951.
This stream may form the basis for other decompression filters, such as the GZipInputStream.
Author of the original java version : John Leuner.
Inheritance
Implements
Inherited Members
Namespace: ICSharpCode.SharpZipLib.Zip.Compression.Streams
Assembly: ICSharpCode.SharpZipLib.dll
Syntax
public class InflaterInputStream : Stream, IDisposable
Constructors
| Improve this Doc View SourceInflaterInputStream(Stream)
Create an InflaterInputStream with the default decompressor and a default buffer size of 4KB.
Declaration
public InflaterInputStream(Stream baseInputStream)
Parameters
Type | Name | Description |
---|---|---|
System.IO.Stream | baseInputStream | The InputStream to read bytes from |
InflaterInputStream(Stream, Inflater)
Create an InflaterInputStream with the specified decompressor and a default buffer size of 4KB.
Declaration
public InflaterInputStream(Stream baseInputStream, Inflater inf)
Parameters
Type | Name | Description |
---|---|---|
System.IO.Stream | baseInputStream | The source of input data |
Inflater | inf | The decompressor used to decompress data read from baseInputStream |
InflaterInputStream(Stream, Inflater, Int32)
Create an InflaterInputStream with the specified decompressor and the specified buffer size.
Declaration
public InflaterInputStream(Stream baseInputStream, Inflater inflater, int bufferSize)
Parameters
Type | Name | Description |
---|---|---|
System.IO.Stream | baseInputStream | The InputStream to read bytes from |
Inflater | inflater | The decompressor to use |
System.Int32 | bufferSize | Size of the buffer to use |
Fields
| Improve this Doc View Sourcecsize
The compressed size
Declaration
protected long csize
Field Value
Type | Description |
---|---|
System.Int64 |
inf
Decompressor for this stream
Declaration
protected Inflater inf
Field Value
Type | Description |
---|---|
Inflater |
inputBuffer
Input buffer for this stream.
Declaration
protected InflaterInputBuffer inputBuffer
Field Value
Type | Description |
---|---|
InflaterInputBuffer |
Properties
| Improve this Doc View SourceAvailable
Returns 0 once the end of the stream (EOF) has been reached. Otherwise returns 1.
Declaration
public virtual int Available { get; }
Property Value
Type | Description |
---|---|
System.Int32 |
CanRead
Gets a value indicating whether the current stream supports reading
Declaration
public override bool CanRead { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
Overrides
CanSeek
Gets a value of false indicating seeking is not supported for this stream.
Declaration
public override bool CanSeek { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
Overrides
CanWrite
Gets a value of false indicating that this stream is not writeable.
Declaration
public override bool CanWrite { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
Overrides
IsStreamOwner
Gets or sets a flag indicating ownership of underlying stream. When the flag is true System.IO.Stream.Dispose() will close the underlying stream also.
Declaration
public bool IsStreamOwner { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
Remarks
The default value is true.
Length
A value representing the length of the stream in bytes.
Declaration
public override long Length { get; }
Property Value
Type | Description |
---|---|
System.Int64 |
Overrides
Position
The current position within the stream. Throws a NotSupportedException when attempting to set the position
Declaration
public override long Position { get; set; }
Property Value
Type | Description |
---|---|
System.Int64 |
Overrides
Exceptions
Type | Condition |
---|---|
System.NotSupportedException | Attempting to set the position |
Methods
| Improve this Doc View SourceDispose(Boolean)
Closes the input stream. When IsStreamOwner is true the underlying stream is also closed.
Declaration
protected override void Dispose(bool disposing)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | disposing |
Overrides
Fill()
Fills the buffer with more data to decompress.
Declaration
protected void Fill()
Exceptions
Type | Condition |
---|---|
SharpZipBaseException | Stream ends early |
Flush()
Flushes the baseInputStream
Declaration
public override void Flush()
Overrides
Read(Byte[], Int32, Int32)
Reads decompressed data into the provided buffer byte array
Declaration
public override int Read(byte[] buffer, int offset, int count)
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | buffer | The array to read and decompress data into |
System.Int32 | offset | The offset indicating where the data should be placed |
System.Int32 | count | The number of bytes to decompress |
Returns
Type | Description |
---|---|
System.Int32 | The number of bytes read. Zero signals the end of stream |
Overrides
Exceptions
Type | Condition |
---|---|
SharpZipBaseException | Inflater needs a dictionary |
Seek(Int64, SeekOrigin)
Sets the position within the current stream Always throws a NotSupportedException
Declaration
public override long Seek(long offset, SeekOrigin origin)
Parameters
Type | Name | Description |
---|---|---|
System.Int64 | offset | The relative offset to seek to. |
System.IO.SeekOrigin | origin | The System.IO.SeekOrigin defining where to seek from. |
Returns
Type | Description |
---|---|
System.Int64 | The new position in the stream. |
Overrides
Exceptions
Type | Condition |
---|---|
System.NotSupportedException | Any access |
SetLength(Int64)
Set the length of the current stream Always throws a NotSupportedException
Declaration
public override void SetLength(long value)
Parameters
Type | Name | Description |
---|---|---|
System.Int64 | value | The new length value for the stream. |
Overrides
Exceptions
Type | Condition |
---|---|
System.NotSupportedException | Any access |
Skip(Int64)
Skip specified number of bytes of uncompressed data
Declaration
public long Skip(long count)
Parameters
Type | Name | Description |
---|---|---|
System.Int64 | count | Number of bytes to skip |
Returns
Type | Description |
---|---|
System.Int64 | The number of bytes skipped, zero if the end of stream has been reached |
Exceptions
Type | Condition |
---|---|
System.ArgumentOutOfRangeException |
|
StopDecrypting()
Clear any cryptographic state.
Declaration
protected void StopDecrypting()
Write(Byte[], Int32, Int32)
Writes a sequence of bytes to stream and advances the current position This method always throws a NotSupportedException
Declaration
public override void Write(byte[] buffer, int offset, int count)
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | buffer | The buffer containing data to write. |
System.Int32 | offset | The offset of the first byte to write. |
System.Int32 | count | The number of bytes to write. |
Overrides
Exceptions
Type | Condition |
---|---|
System.NotSupportedException | Any access |
WriteByte(Byte)
Writes one byte to the current stream and advances the current position Always throws a NotSupportedException
Declaration
public override void WriteByte(byte value)
Parameters
Type | Name | Description |
---|---|---|
System.Byte | value | The byte to write. |
Overrides
Exceptions
Type | Condition |
---|---|
System.NotSupportedException | Any access |