Class BZip2InputStream
An input stream that decompresses files in the BZip2 format
Inheritance
Implements
Inherited Members
Namespace: ICSharpCode.SharpZipLib.BZip2
Assembly: ICSharpCode.SharpZipLib.dll
Syntax
public class BZip2InputStream : Stream, IDisposable
Constructors
| Improve this Doc View SourceBZip2InputStream(Stream)
Construct instance for reading from stream
Declaration
public BZip2InputStream(Stream stream)
Parameters
| Type | Name | Description |
|---|---|---|
| System.IO.Stream | stream | Data source |
Properties
| Improve this Doc View SourceCanRead
Gets a value indicating if the stream supports reading
Declaration
public override bool CanRead { get; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
Overrides
CanSeek
Gets a value indicating whether the current stream supports seeking.
Declaration
public override bool CanSeek { get; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
Overrides
CanWrite
Gets a value indicating whether the current stream supports writing. This property always returns false
Declaration
public override bool CanWrite { get; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
Overrides
IsStreamOwner
Get/set 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 |
Length
Gets the length in bytes of the stream.
Declaration
public override long Length { get; }
Property Value
| Type | Description |
|---|---|
| System.Int64 |
Overrides
Position
Gets the current position of the stream. Setting the position is not supported and will throw a NotSupportException.
Declaration
public override long Position { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Int64 |
Overrides
Exceptions
| Type | Condition |
|---|---|
| System.NotSupportedException | Any attempt to set the position. |
Methods
| Improve this Doc View SourceDispose(Boolean)
Closes the stream, releasing any associated resources.
Declaration
protected override void Dispose(bool disposing)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Boolean | disposing |
Overrides
Flush()
Flushes the stream.
Declaration
public override void Flush()
Overrides
Read(Byte[], Int32, Int32)
Read a sequence of bytes and advances the read position by one byte.
Declaration
public override int Read(byte[] buffer, int offset, int count)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Byte[] | buffer | Array of bytes to store values in |
| System.Int32 | offset | Offset in array to begin storing data |
| System.Int32 | count | The maximum number of bytes to read |
Returns
| Type | Description |
|---|---|
| System.Int32 | The total number of bytes read into the buffer. This might be less than the number of bytes requested if that number of bytes are not currently available or zero if the end of the stream is reached. |
Overrides
ReadByte()
Read a byte from stream advancing position
Declaration
public override int ReadByte()
Returns
| Type | Description |
|---|---|
| System.Int32 | byte read or -1 on end of stream |
Overrides
Seek(Int64, SeekOrigin)
Set the streams position. This operation is not supported and will throw a NotSupportedException
Declaration
public override long Seek(long offset, SeekOrigin origin)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int64 | offset | A byte offset relative to the |
| System.IO.SeekOrigin | origin | A value of type System.IO.SeekOrigin indicating the reference point used to obtain the new position. |
Returns
| Type | Description |
|---|---|
| System.Int64 | The new position of the stream. |
Overrides
Exceptions
| Type | Condition |
|---|---|
| System.NotSupportedException | Any access |
SetLength(Int64)
Sets the length of this stream to the given value. This operation is not supported and will throw a NotSupportedExceptionortedException
Declaration
public override void SetLength(long value)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int64 | value | The new length for the stream. |
Overrides
Exceptions
| Type | Condition |
|---|---|
| System.NotSupportedException | Any access |
Write(Byte[], Int32, Int32)
Writes a block of bytes to this stream using data from a buffer. This operation is not supported and will throw a NotSupportedException
Declaration
public override void Write(byte[] buffer, int offset, int count)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Byte[] | buffer | The buffer to source data from. |
| System.Int32 | offset | The offset to start obtaining data from. |
| System.Int32 | count | The number of bytes of data to write. |
Overrides
Exceptions
| Type | Condition |
|---|---|
| System.NotSupportedException | Any access |
WriteByte(Byte)
Writes a byte to the current position in the file stream. This operation is not supported and will throw a NotSupportedException
Declaration
public override void WriteByte(byte value)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Byte | value | The value to write. |
Overrides
Exceptions
| Type | Condition |
|---|---|
| System.NotSupportedException | Any access |