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.
More...
|
| | LzwInputStream (Stream baseInputStream) |
| | Creates a LzwInputStream.
|
| override int | ReadByte () |
| | See System.IO.Stream.ReadByte
|
| override int | Read (byte[] buffer, int offset, int count) |
| | Reads decompressed data into the provided buffer byte array.
|
| 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.
|
|
| bool | IsStreamOwner [get, set] |
| | Get/set flag indicating ownership of underlying stream. When the flag is true Close will close the underlying stream also.
|
| 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.
|
|
| int | ResetBuf (int bitPosition) |
| | Moves the unread data in the buffer to the beginning and resets the pointers.
|
| void | Fill () |
| void | ParseHeader () |
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.
This sample shows how to unzip a compressed file
using System;
using System.IO;
class MainClass
{
public static void Main(string[] args)
{
using (FileStream outStream =
File.Create(Path.GetFileNameWithoutExtension(args[0]))) {
byte[] buffer = new byte[4096];
inStream.Read(buffer, 0, buffer.Length);
}
}
} <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
Definition FileSystemScanner.cs:40
Definition LzwConstants.cs:36
◆ LzwInputStream()
| ICSharpCode.SharpZipLib.LZW.LzwInputStream.LzwInputStream |
( |
Stream | baseInputStream | ) |
|
Creates a LzwInputStream.
- Parameters
-
| baseInputStream | The stream to read compressed data from (baseInputStream LZW format) |
◆ BeginWrite()
| override IAsyncResult ICSharpCode.SharpZipLib.LZW.LzwInputStream.BeginWrite |
( |
byte[] | buffer, |
|
|
int | offset, |
|
|
int | count, |
|
|
AsyncCallback | callback, |
|
|
object | state ) |
Entry point to begin an asynchronous write. Always throws a NotSupportedException.
- Parameters
-
| buffer | The buffer to write data from |
| offset | Offset of first byte to write |
| count | The maximum number of bytes to write |
| callback | The method to be called when the asynchronous write operation is completed |
| state | A user-provided object that distinguishes this particular asynchronous write request from other requests |
- Returns
- An IAsyncResult that references the asynchronous write
- Exceptions
-
| NotSupportedException | Any access |
◆ Close()
| override void ICSharpCode.SharpZipLib.LZW.LzwInputStream.Close |
( |
| ) |
|
Closes the input stream. When IsStreamOwner is true the underlying stream is also closed.
◆ Fill()
| void ICSharpCode.SharpZipLib.LZW.LzwInputStream.Fill |
( |
| ) |
|
|
private |
◆ Flush()
| override void ICSharpCode.SharpZipLib.LZW.LzwInputStream.Flush |
( |
| ) |
|
Flushes the baseInputStream.
◆ ParseHeader()
| void ICSharpCode.SharpZipLib.LZW.LzwInputStream.ParseHeader |
( |
| ) |
|
|
private |
◆ Read()
| override int ICSharpCode.SharpZipLib.LZW.LzwInputStream.Read |
( |
byte[] | buffer, |
|
|
int | offset, |
|
|
int | count ) |
Reads decompressed data into the provided buffer byte array.
- Parameters
-
| buffer | The array to read and decompress data into |
| offset | The offset indicating where the data should be placed |
| count | The number of bytes to decompress |
- Returns
- The number of bytes read. Zero signals the end of stream
◆ ReadByte()
| override int ICSharpCode.SharpZipLib.LZW.LzwInputStream.ReadByte |
( |
| ) |
|
See System.IO.Stream.ReadByte
- Returns
◆ ResetBuf()
| int ICSharpCode.SharpZipLib.LZW.LzwInputStream.ResetBuf |
( |
int | bitPosition | ) |
|
|
private |
Moves the unread data in the buffer to the beginning and resets the pointers.
- Parameters
-
- Returns
◆ Seek()
| override long ICSharpCode.SharpZipLib.LZW.LzwInputStream.Seek |
( |
long | offset, |
|
|
SeekOrigin | origin ) |
Sets the position within the current stream Always throws a NotSupportedException.
- Parameters
-
| offset | The relative offset to seek to. |
| origin | The SeekOrigin defining where to seek from. |
- Returns
- The new position in the stream.
- Exceptions
-
| NotSupportedException | Any access |
◆ SetLength()
| override void ICSharpCode.SharpZipLib.LZW.LzwInputStream.SetLength |
( |
long | value | ) |
|
Set the length of the current stream Always throws a NotSupportedException.
- Parameters
-
| value | The new length value for the stream. |
- Exceptions
-
| NotSupportedException | Any access |
◆ Write()
| override void ICSharpCode.SharpZipLib.LZW.LzwInputStream.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.
- Parameters
-
| buffer | Thew buffer containing data to write. |
| offset | The offset of the first byte to write. |
| count | The number of bytes to write. |
- Exceptions
-
| NotSupportedException | Any access |
◆ WriteByte()
| override void ICSharpCode.SharpZipLib.LZW.LzwInputStream.WriteByte |
( |
byte | value | ) |
|
Writes one byte to the current stream and advances the current position Always throws a NotSupportedException.
- Parameters
-
- Exceptions
-
| NotSupportedException | Any access |
◆ baseInputStream
| Stream ICSharpCode.SharpZipLib.LZW.LzwInputStream.baseInputStream |
|
private |
◆ bitMask
| int ICSharpCode.SharpZipLib.LZW.LzwInputStream.bitMask |
|
private |
◆ bitPos
| int ICSharpCode.SharpZipLib.LZW.LzwInputStream.bitPos |
|
private |
◆ blockMode
| bool ICSharpCode.SharpZipLib.LZW.LzwInputStream.blockMode |
|
private |
◆ data
| readonly byte [] ICSharpCode.SharpZipLib.LZW.LzwInputStream.data = new byte[1024 * 8] |
|
private |
◆ end
| int ICSharpCode.SharpZipLib.LZW.LzwInputStream.end |
|
private |
◆ eof
| bool ICSharpCode.SharpZipLib.LZW.LzwInputStream.eof |
|
private |
◆ EXTRA
| const int ICSharpCode.SharpZipLib.LZW.LzwInputStream.EXTRA = 64 |
|
staticprivate |
◆ finChar
| byte ICSharpCode.SharpZipLib.LZW.LzwInputStream.finChar |
|
private |
◆ freeEnt
| int ICSharpCode.SharpZipLib.LZW.LzwInputStream.freeEnt |
|
private |
◆ got
| int ICSharpCode.SharpZipLib.LZW.LzwInputStream.got |
|
private |
◆ headerParsed
| bool ICSharpCode.SharpZipLib.LZW.LzwInputStream.headerParsed |
|
private |
◆ isClosed
| bool ICSharpCode.SharpZipLib.LZW.LzwInputStream.isClosed |
|
private |
Flag indicating wether this instance has been closed or not.
◆ isStreamOwner
| bool ICSharpCode.SharpZipLib.LZW.LzwInputStream.isStreamOwner = true |
|
private |
Flag indicating wether this instance is designated the stream owner. When closing if this flag is true the underlying stream is closed.
◆ maxBits
| int ICSharpCode.SharpZipLib.LZW.LzwInputStream.maxBits |
|
private |
◆ maxCode
| int ICSharpCode.SharpZipLib.LZW.LzwInputStream.maxCode |
|
private |
◆ maxMaxCode
| int ICSharpCode.SharpZipLib.LZW.LzwInputStream.maxMaxCode |
|
private |
◆ nBits
| int ICSharpCode.SharpZipLib.LZW.LzwInputStream.nBits |
|
private |
◆ oldCode
| int ICSharpCode.SharpZipLib.LZW.LzwInputStream.oldCode |
|
private |
◆ one
| readonly byte [] ICSharpCode.SharpZipLib.LZW.LzwInputStream.one = new byte[1] |
|
private |
◆ stack
| byte [] ICSharpCode.SharpZipLib.LZW.LzwInputStream.stack |
|
private |
◆ stackP
| int ICSharpCode.SharpZipLib.LZW.LzwInputStream.stackP |
|
private |
◆ tabPrefix
| int [] ICSharpCode.SharpZipLib.LZW.LzwInputStream.tabPrefix |
|
private |
◆ tabSuffix
| byte [] ICSharpCode.SharpZipLib.LZW.LzwInputStream.tabSuffix |
|
private |
◆ TBL_CLEAR
| const int ICSharpCode.SharpZipLib.LZW.LzwInputStream.TBL_CLEAR = 0x100 |
|
staticprivate |
◆ TBL_FIRST
| const int ICSharpCode.SharpZipLib.LZW.LzwInputStream.TBL_FIRST = TBL_CLEAR + 1 |
|
staticprivate |
◆ zeros
| readonly int [] ICSharpCode.SharpZipLib.LZW.LzwInputStream.zeros = new int[256] |
|
private |
◆ CanRead
| override bool ICSharpCode.SharpZipLib.LZW.LzwInputStream.CanRead |
|
get |
Gets a value indicating whether the current stream supports reading.
◆ CanSeek
| override bool ICSharpCode.SharpZipLib.LZW.LzwInputStream.CanSeek |
|
get |
Gets a value of false indicating seeking is not supported for this stream.
◆ CanWrite
| override bool ICSharpCode.SharpZipLib.LZW.LzwInputStream.CanWrite |
|
get |
Gets a value of false indicating that this stream is not writeable.
◆ IsStreamOwner
| bool ICSharpCode.SharpZipLib.LZW.LzwInputStream.IsStreamOwner |
|
getset |
Get/set flag indicating ownership of underlying stream. When the flag is true Close will close the underlying stream also.
The default value is true.
◆ Length
| override long ICSharpCode.SharpZipLib.LZW.LzwInputStream.Length |
|
get |
A value representing the length of the stream in bytes.
◆ Position
| override long ICSharpCode.SharpZipLib.LZW.LzwInputStream.Position |
|
getset |
The current position within the stream. Throws a NotSupportedException when attempting to set the position.
- Exceptions
-
| NotSupportedException | Attempting to set the position |
The documentation for this class was generated from the following file: