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: fanfeilong/exceltk Class Usage Examples

Public Methods

Method Description
BeginWrite ( byte buffer, int offset, int count, AsyncCallback callback, object state ) : IAsyncResult

Entry point to begin an asynchronous write. Always throws a NotSupportedException.

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

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

BeginWrite() public method

Entry point to begin an asynchronous write. Always throws a NotSupportedException.
Any access
public BeginWrite ( byte buffer, int offset, int count, AsyncCallback callback, object state ) : IAsyncResult
buffer byte The buffer to write data from
offset int Offset of first byte to write
count int The maximum number of bytes to write
callback AsyncCallback The method to be called when the asynchronous write operation is completed
state object A user-provided object that distinguishes this particular asynchronous write request from other requests
return IAsyncResult

Dispose() protected method

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