Class OutputWindow
Contains the output from the Inflation process.
We need to have a window so that we can refer backwards into the output stream
to repeat stuff.
Author of the original java version : John Leuner
Inheritance
Inherited Members
Namespace: ICSharpCode.SharpZipLib.Zip.Compression.Streams
Assembly: ICSharpCode.SharpZipLib.dll
Syntax
public class OutputWindow
Methods
| Improve this Doc View SourceCopyDict(Byte[], Int32, Int32)
Copy dictionary to window
Declaration
public void CopyDict(byte[] dictionary, int offset, int length)
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | dictionary | source dictionary |
System.Int32 | offset | offset of start in source dictionary |
System.Int32 | length | length of dictionary |
Exceptions
Type | Condition |
---|---|
System.InvalidOperationException | If window isnt empty |
CopyOutput(Byte[], Int32, Int32)
Copy contents of window to output
Declaration
public int CopyOutput(byte[] output, int offset, int len)
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | output | buffer to copy to |
System.Int32 | offset | offset to start at |
System.Int32 | len | number of bytes to count |
Returns
Type | Description |
---|---|
System.Int32 | The number of bytes copied |
Exceptions
Type | Condition |
---|---|
System.InvalidOperationException | If a window underflow occurs |
CopyStored(StreamManipulator, Int32)
Copy from input manipulator to internal window
Declaration
public int CopyStored(StreamManipulator input, int length)
Parameters
Type | Name | Description |
---|---|---|
StreamManipulator | input | source of data |
System.Int32 | length | length of data to copy |
Returns
Type | Description |
---|---|
System.Int32 | the number of bytes copied |
GetAvailable()
Get bytes available for output in window
Declaration
public int GetAvailable()
Returns
Type | Description |
---|---|
System.Int32 | Number of bytes filled |
GetFreeSpace()
Get remaining unfilled space in window
Declaration
public int GetFreeSpace()
Returns
Type | Description |
---|---|
System.Int32 | Number of bytes left in window |
Repeat(Int32, Int32)
Append a byte pattern already in the window itself
Declaration
public void Repeat(int length, int distance)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | length | length of pattern to copy |
System.Int32 | distance | distance from end of window pattern occurs |
Exceptions
Type | Condition |
---|---|
System.InvalidOperationException | If the repeated data overflows the window |
Reset()
Reset by clearing window so GetAvailable returns 0
Declaration
public void Reset()
Write(Int32)
Write a byte to this output window
Declaration
public void Write(int value)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | value | value to write |
Exceptions
Type | Condition |
---|---|
System.InvalidOperationException | if window is full |