Legend

Class
Struct
Enum
Interface
Delegate
Constructor
Method
Property
Event
Field

Sealed class: RT.Util.Streams.TimeoutableStream

Summary

Implements a stream whose synchronous read/write operations respect the Stream.ReadTimeoutand Stream.WriteTimeout properties. Useful for wrapping streams which do not directly support these properties.

Constructors

TimeoutableStream(Stream underlyingStream)
Constructor.

Instance methods

void
  • Overrides: Stream.Flush()
Flushes the underlying stream.
int
Read(byte[] buffer, int offset, int count)
  • Overrides: Stream.Read(byte[], int, int)
Reads up to count bytes into buffer starting at offset from the underlying stream, if it supports this. Will block waiting for the read to complete for at most Stream.ReadTimeout milliseconds; afterwards, a TimeoutException is thrown.
long
Seek(long offset, SeekOrigin origin)
  • Overrides: Stream.Seek(long, SeekOrigin)
Seeks to the specified position in the underlying stream, if the underlying stream supports it.
void
SetLength(long value)
  • Overrides: Stream.SetLength(long)
Sets the length of the underlying stream, if supported by it.
void
Write(byte[] buffer, int offset, int count)
  • Overrides: Stream.Write(byte[], int, int)
Writes count bytes from buffer starting at offset to the underlying stream, if it supports this. Will block waiting for the write to complete for at most Stream.WriteTimeout milliseconds; afterwards, a TimeoutException is thrown.

Instance properties

bool
  • Overrides: Stream.CanRead
Indicates whether the underlying stream, and hence this stream, supports reading.
bool
  • Overrides: Stream.CanSeek
Indicates whether the underlying stream, and hence this stream, supports seeking.
bool
  • Overrides: Stream.CanTimeout
Always returns true.
bool
  • Overrides: Stream.CanWrite
Indicates whether the underlying stream, and hence this stream, supports writing.
long
  • Overrides: Stream.Length
Gets the length of the underlying stream, if supported by it.
long
  • Overrides: Stream.Position
Gets or sets the current position in the stream, if supported by the underlying stream.
int
  • Overrides: Stream.ReadTimeout
Gets or sets a value, in miliseconds, that determines how long the stream will attempt to read before timing out. Specify Timeout.Infinite to suppress the time-out (which is the default value).
int
  • Overrides: Stream.WriteTimeout
Gets or sets a value, in miliseconds, that determines how long the stream will attempt to write before timing out. Specify Timeout.Infinite to suppress the time-out (which is the default value).