C# Class ICSharpCode.SharpZipLib.Lzw.LzwInputStream

This filter stream is used to decompress a LZW format stream. Specifically, a stream that uses the LZC compression method. This file format is usually associated with the .Z file extension. See http://en.wikipedia.org/wiki/Compress See http://wiki.wxwidgets.org/Development:_Z_File_Format The file header consists of 3 (or optionally 4) bytes. The first two bytes contain the magic marker "0x1f 0x9d", followed by a byte of flags. Based on Java code by Ronald Tschalar, which in turn was based on the unlzw.c code in the gzip package.
Inheritance: Stream
Show file Open project: icsharpcode/SharpZipLib Class Usage Examples

Public Methods

Method Description
Flush ( ) : void

Flushes the baseInputStream

LzwInputStream ( Stream baseInputStream ) : System

Creates a LzwInputStream

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

Reads decompressed data into the provided buffer byte array

ReadByte ( ) : int

See System.IO.Stream.ReadByte

Seek ( long offset, SeekOrigin origin ) : long

Sets the position within the current stream Always throws a NotSupportedException

SetLength ( long value ) : void

Set the length of the current stream Always throws a NotSupportedException

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

Writes a sequence of bytes to stream and advances the current position This method always throws a NotSupportedException

WriteByte ( byte value ) : void

Writes one byte to the current stream and advances the current position Always throws a NotSupportedException

Protected Methods

Method Description
Dispose ( bool disposing ) : void

Closes the input stream. When is true the underlying stream is also closed.

Private Methods

Method Description
Fill ( ) : void
ParseHeader ( ) : void
ResetBuf ( int bitPosition ) : int

Moves the unread data in the buffer to the beginning and resets the pointers.

Method Details

Dispose() protected method

Closes the input stream. When is true the underlying stream is also closed.
protected Dispose ( bool disposing ) : void
disposing bool
return void

Flush() public method

Flushes the baseInputStream
public Flush ( ) : void
return void

LzwInputStream() public method

Creates a LzwInputStream
public LzwInputStream ( Stream baseInputStream ) : System
baseInputStream Stream /// The stream to read compressed data from (baseInputStream LZW format) ///
return System

Read() public method

Reads decompressed data into the provided buffer byte array
public Read ( byte buffer, int offset, int count ) : int
buffer byte /// The array to read and decompress data into ///
offset int /// The offset indicating where the data should be placed ///
count int /// The number of bytes to decompress ///
return int

ReadByte() public method

See System.IO.Stream.ReadByte
public ReadByte ( ) : int
return int

Seek() public method

Sets the position within the current stream Always throws a NotSupportedException
Any access
public Seek ( long offset, SeekOrigin origin ) : long
offset long The relative offset to seek to.
origin SeekOrigin The defining where to seek from.
return long

SetLength() public method

Set the length of the current stream Always throws a NotSupportedException
Any access
public SetLength ( long value ) : void
value long The new length value for the stream.
return void

Write() public method

Writes a sequence of bytes to stream and advances the current position This method always throws a NotSupportedException
Any access
public Write ( byte buffer, int offset, int count ) : void
buffer byte Thew buffer containing data to write.
offset int The offset of the first byte to write.
count int The number of bytes to write.
return void

WriteByte() public method

Writes one byte to the current stream and advances the current position Always throws a NotSupportedException
Any access
public WriteByte ( byte value ) : void
value byte The byte to write.
return void