Show / Hide Table of Contents

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
System.Object
System.MarshalByRefObject
System.IO.Stream
InflaterInputStream
GZipInputStream
ZipInputStream
Implements
System.IDisposable
Inherited Members
System.IO.Stream.Null
System.IO.Stream.BeginRead(System.Byte[], System.Int32, System.Int32, System.AsyncCallback, System.Object)
System.IO.Stream.BeginWrite(System.Byte[], System.Int32, System.Int32, System.AsyncCallback, System.Object)
System.IO.Stream.Close()
System.IO.Stream.CopyTo(System.IO.Stream)
System.IO.Stream.CopyTo(System.IO.Stream, System.Int32)
System.IO.Stream.CopyToAsync(System.IO.Stream)
System.IO.Stream.CopyToAsync(System.IO.Stream, System.Int32)
System.IO.Stream.CopyToAsync(System.IO.Stream, System.Int32, System.Threading.CancellationToken)
System.IO.Stream.CreateWaitHandle()
System.IO.Stream.Dispose()
System.IO.Stream.EndRead(System.IAsyncResult)
System.IO.Stream.EndWrite(System.IAsyncResult)
System.IO.Stream.FlushAsync()
System.IO.Stream.FlushAsync(System.Threading.CancellationToken)
System.IO.Stream.ObjectInvariant()
System.IO.Stream.ReadAsync(System.Byte[], System.Int32, System.Int32)
System.IO.Stream.ReadAsync(System.Byte[], System.Int32, System.Int32, System.Threading.CancellationToken)
System.IO.Stream.ReadByte()
System.IO.Stream.Synchronized(System.IO.Stream)
System.IO.Stream.WriteAsync(System.Byte[], System.Int32, System.Int32)
System.IO.Stream.WriteAsync(System.Byte[], System.Int32, System.Int32, System.Threading.CancellationToken)
System.IO.Stream.CanTimeout
System.IO.Stream.ReadTimeout
System.IO.Stream.WriteTimeout
System.MarshalByRefObject.GetLifetimeService()
System.MarshalByRefObject.InitializeLifetimeService()
System.MarshalByRefObject.MemberwiseClone(System.Boolean)
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: ICSharpCode.SharpZipLib.Zip.Compression.Streams
Assembly: ICSharpCode.SharpZipLib.dll
Syntax
public class InflaterInputStream : Stream, IDisposable

Constructors

| Improve this Doc View Source

InflaterInputStream(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

| Improve this Doc View Source

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

| Improve this Doc View Source

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 Source

csize

The compressed size

Declaration
protected long csize
Field Value
Type Description
System.Int64
| Improve this Doc View Source

inf

Decompressor for this stream

Declaration
protected Inflater inf
Field Value
Type Description
Inflater
| Improve this Doc View Source

inputBuffer

Input buffer for this stream.

Declaration
protected InflaterInputBuffer inputBuffer
Field Value
Type Description
InflaterInputBuffer

Properties

| Improve this Doc View Source

Available

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
| Improve this Doc View Source

CanRead

Gets a value indicating whether the current stream supports reading

Declaration
public override bool CanRead { get; }
Property Value
Type Description
System.Boolean
Overrides
System.IO.Stream.CanRead
| Improve this Doc View Source

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
System.IO.Stream.CanSeek
| Improve this Doc View Source

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
System.IO.Stream.CanWrite
| Improve this Doc View Source

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.

| Improve this Doc View Source

Length

A value representing the length of the stream in bytes.

Declaration
public override long Length { get; }
Property Value
Type Description
System.Int64
Overrides
System.IO.Stream.Length
| Improve this Doc View Source

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
System.IO.Stream.Position
Exceptions
Type Condition
System.NotSupportedException

Attempting to set the position

Methods

| Improve this Doc View Source

Dispose(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
System.IO.Stream.Dispose(System.Boolean)
| Improve this Doc View Source

Fill()

Fills the buffer with more data to decompress.

Declaration
protected void Fill()
Exceptions
Type Condition
SharpZipBaseException

Stream ends early

| Improve this Doc View Source

Flush()

Flushes the baseInputStream

Declaration
public override void Flush()
Overrides
System.IO.Stream.Flush()
| Improve this Doc View Source

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
System.IO.Stream.Read(System.Byte[], System.Int32, System.Int32)
Exceptions
Type Condition
SharpZipBaseException

Inflater needs a dictionary

| Improve this Doc View Source

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
System.IO.Stream.Seek(System.Int64, System.IO.SeekOrigin)
Exceptions
Type Condition
System.NotSupportedException

Any access

| Improve this Doc View Source

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
System.IO.Stream.SetLength(System.Int64)
Exceptions
Type Condition
System.NotSupportedException

Any access

| Improve this Doc View Source

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

count to skip is less than or equal to zero.

| Improve this Doc View Source

StopDecrypting()

Clear any cryptographic state.

Declaration
protected void StopDecrypting()
| Improve this Doc View Source

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
System.IO.Stream.Write(System.Byte[], System.Int32, System.Int32)
Exceptions
Type Condition
System.NotSupportedException

Any access

| Improve this Doc View Source

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
System.IO.Stream.WriteByte(System.Byte)
Exceptions
Type Condition
System.NotSupportedException

Any access

Implements

System.IDisposable
  • Improve this Doc
  • View Source
In This Article
Back to top Copyright © 2000-2022 SharpZipLib Contributors