Show / Hide Table of Contents

Class BZip2InputStream

An input stream that decompresses files in the BZip2 format

Inheritance
System.Object
System.MarshalByRefObject
System.IO.Stream
BZip2InputStream
Implements
System.IDisposable
Inherited Members
System.IO.Stream.Null
System.IO.Stream.BeginRead(System.Byte[], System.Int32, System.Int32, System.AsyncCallback, System.Object)
System.IO.Stream.BeginWrite(System.Byte[], System.Int32, System.Int32, System.AsyncCallback, System.Object)
System.IO.Stream.Close()
System.IO.Stream.CopyTo(System.IO.Stream)
System.IO.Stream.CopyTo(System.IO.Stream, System.Int32)
System.IO.Stream.CopyToAsync(System.IO.Stream)
System.IO.Stream.CopyToAsync(System.IO.Stream, System.Int32)
System.IO.Stream.CopyToAsync(System.IO.Stream, System.Int32, System.Threading.CancellationToken)
System.IO.Stream.CreateWaitHandle()
System.IO.Stream.Dispose()
System.IO.Stream.EndRead(System.IAsyncResult)
System.IO.Stream.EndWrite(System.IAsyncResult)
System.IO.Stream.FlushAsync()
System.IO.Stream.FlushAsync(System.Threading.CancellationToken)
System.IO.Stream.ObjectInvariant()
System.IO.Stream.ReadAsync(System.Byte[], System.Int32, System.Int32)
System.IO.Stream.ReadAsync(System.Byte[], System.Int32, System.Int32, System.Threading.CancellationToken)
System.IO.Stream.Synchronized(System.IO.Stream)
System.IO.Stream.WriteAsync(System.Byte[], System.Int32, System.Int32)
System.IO.Stream.WriteAsync(System.Byte[], System.Int32, System.Int32, System.Threading.CancellationToken)
System.IO.Stream.CanTimeout
System.IO.Stream.ReadTimeout
System.IO.Stream.WriteTimeout
System.MarshalByRefObject.GetLifetimeService()
System.MarshalByRefObject.InitializeLifetimeService()
System.MarshalByRefObject.MemberwiseClone(System.Boolean)
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: ICSharpCode.SharpZipLib.BZip2
Assembly: ICSharpCode.SharpZipLib.dll
Syntax
public class BZip2InputStream : Stream, IDisposable

Constructors

| Improve this Doc View Source

BZip2InputStream(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 Source

CanRead

Gets a value indicating if the stream supports reading

Declaration
public override bool CanRead { get; }
Property Value
Type Description
System.Boolean
Overrides
System.IO.Stream.CanRead
| Improve this Doc View Source

CanSeek

Gets a value indicating whether the current stream supports seeking.

Declaration
public override bool CanSeek { get; }
Property Value
Type Description
System.Boolean
Overrides
System.IO.Stream.CanSeek
| Improve this Doc View Source

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
System.IO.Stream.CanWrite
| Improve this Doc View Source

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
| Improve this Doc View Source

Length

Gets the length in bytes of the stream.

Declaration
public override long Length { get; }
Property Value
Type Description
System.Int64
Overrides
System.IO.Stream.Length
| Improve this Doc View Source

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
System.IO.Stream.Position
Exceptions
Type Condition
System.NotSupportedException

Any attempt to set the position.

Methods

| Improve this Doc View Source

Dispose(Boolean)

Closes the stream, releasing any associated resources.

Declaration
protected override void Dispose(bool disposing)
Parameters
Type Name Description
System.Boolean disposing
Overrides
System.IO.Stream.Dispose(System.Boolean)
| Improve this Doc View Source

Flush()

Flushes the stream.

Declaration
public override void Flush()
Overrides
System.IO.Stream.Flush()
| Improve this Doc View Source

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
System.IO.Stream.Read(System.Byte[], System.Int32, System.Int32)
| Improve this Doc View Source

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
System.IO.Stream.ReadByte()
| Improve this Doc View Source

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 origin parameter.

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
System.IO.Stream.Seek(System.Int64, System.IO.SeekOrigin)
Exceptions
Type Condition
System.NotSupportedException

Any access

| Improve this Doc View Source

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
System.IO.Stream.SetLength(System.Int64)
Exceptions
Type Condition
System.NotSupportedException

Any access

| Improve this Doc View Source

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
System.IO.Stream.Write(System.Byte[], System.Int32, System.Int32)
Exceptions
Type Condition
System.NotSupportedException

Any access

| Improve this Doc View Source

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
System.IO.Stream.WriteByte(System.Byte)
Exceptions
Type Condition
System.NotSupportedException

Any access

Implements

System.IDisposable
  • Improve this Doc
  • View Source
In This Article
Back to top Copyright © 2000-2022 SharpZipLib Contributors