PeterO.PartialStream

## PeterO.PartialStream

public sealed class PartialStream :
    System.IO.Stream,
    System.IAsyncDisposable,
    System.IDisposable

Represents a portion of another data stream. For this to work, the underlying stream must be seekable and have a known length.

Member Summary

### PartialStream Constructor

public PartialStream(
    System.IO.Stream stream,
    long start,
    long length);

Initializes a new instance of the PeterO.PartialStream class.

Parameters:

### PartialStream Constructor

public PartialStream(
    System.IO.Stream stream,
    long start,
    long length,
    bool closeOnDispose);

Initializes a new instance of the PeterO.PartialStream class.

Parameters:

Exceptions:

### CanRead

public override bool CanRead { get; }

Gets a value indicating whether the underlying stream supports reading.

Returns:

true If the underlying stream supports reading; otherwise, false .

### CanSeek

public override bool CanSeek { get; }

Gets a value indicating whether the underlying stream supports seeking.

Returns:

true If the underlying stream supports seeking; otherwise, false .

### CanWrite

public override bool CanWrite { get; }

Gets a value indicating whether the underlying stream supports writing.

Returns:

true If the underlying stream supports writing; otherwise, false .

### Length

public override long Length { get; }

Gets the partial stream’s length in bytes.

Returns:

The partial stream’s length in bytes.

### Position

public override long Position { get; set; }

Gets the partial stream’s current byte position.

Returns:

The partial stream’s current byte position.

### Flush

public override void Flush();

Not documented yet.

### Read

public override int Read(
    byte[] buffer,
    int offset,
    int count);

Not documented yet.

Parameters:

Return Value:

A 32-bit signed integer.

Exceptions:

### Seek

public override long Seek(
    long offset,
    System.IO.SeekOrigin origin);

Not documented yet.

Parameters:

Return Value:

A 64-bit signed integer.

### SetLength

public override void SetLength(
    long value);

Not documented yet.

Parameters:

### Write

public override void Write(
    byte[] buffer,
    int offset,
    int count);

Not documented yet.

Parameters:

Exceptions:

Back to petero-csharp start page.