| All Members | Constructors | Methods | Properties | Fields | Events |
| Icon | Member | Description |
|---|---|---|
| AsyncStreamNew(Stream, AsyncStreamMode, Int32) |
Creates a new AsyncStream that closes its BaseStream when Close()'ed and does not ignore calls to Flush() with the default MinimumIOSize and MaximumIOSize.
| |
| AsyncStreamNew(Stream, AsyncStreamMode, Int32, Int32, Int32) |
Creates a new AsyncStream that closes its BaseStream when Close()'ed and does not ignore calls to Flush().
| |
| AsyncStreamNew(Stream, AsyncStreamMode, Int32, Int32, Int32, Boolean, Boolean) |
Creates a new AsyncStream.
| |
| AsyncStreamNew(Stream, AsyncStreamMode, Byte[](), Int32, Int32, Boolean, Boolean) |
Creates a new AsyncStream using an existing byte array as a buffer.
| |
| AsyncStreamNew(Stream, AsyncStreamMode, Int32, ThreadPriority) |
Creates a new AsyncStream that closes its BaseStream when Close()'ed and does not ignore calls to Flush() with the default MinimumIOSize and MaximumIOSize.
| |
| AsyncStreamNew(Stream, AsyncStreamMode, Int32, Int32, Int32, ThreadPriority) |
Creates a new AsyncStream that closes its BaseStream when Close()'ed and does not ignore calls to Flush().
| |
| AsyncStreamNew(Stream, AsyncStreamMode, Int32, Int32, Int32, Boolean, Boolean, ThreadPriority) |
Creates a new AsyncStream.
| |
| AsyncStreamNew(Stream, AsyncStreamMode, Byte[](), Int32, Int32, Boolean, Boolean, ThreadPriority) |
Creates a new AsyncStream using an existing byte array as a buffer.
| |
| AsynchronousException |
The AsynchronousBaseStreamException that will be thrown the next
time a method is invoked or Position or Mode are set, or null
if there is no such pending exception.
| |
| Available |
In writing mode, the number of bytes that can currently be written via Write() or WriteByte() without blocking.
In reading mode, returns the number of bytes that can currently be read via Read() or ReadByte() without blocking
or -1 if the end of the stream has been reached.
This property is read-only.
| |
| BackgroundThreadPriority |
Retrieves or sets the priority for the background thread the AsyncStream uses for asychronous I/O.
| |
| BaseStream |
Retrieves the underlying stream wrapped by this AsyncStream.
| |
| BeginRead(Byte[](), Int32, Int32, AsyncCallback, Object) | Begins an asynchronous read operation. (Inherited from Stream.) | |
| BeginWrite(Byte[](), Int32, Int32, AsyncCallback, Object) | Begins an asynchronous write operation. (Inherited from Stream.) | |
| BufferSize |
Gets the number of bytes the AsyncStream is using to buffer data for I/O with the underlying stream.
The size of the buffer is determined by the relevant argument passed to the constructor, and
is read-only thereafter.
| |
| CanRead |
True if the underlying stream supports reading.
(Overrides Stream.CanRead.) | |
| CanSeek |
True if the underlying stream supports seeking.
(Overrides Stream.CanSeek.) | |
| CanTimeout | Gets a value that determines whether the current stream can time out. (Inherited from Stream.) | |
| CanWrite |
True if the underlying stream supports writing.
(Overrides Stream.CanWrite.) | |
| ClearAsynchronousException() |
Immediately discards any exception previously thrown by the underlying
stream during asynchronous I/O and resumes the asynchronous I/O background thread.
| |
| Close() |
Releases the internal buffers and other resources used by
this AsyncStream and calls ForceFlush(). The underlying
stream is also closed if CloseBaseStream is true.
Has no effect if the AsyncStream has already been closed.
(Overrides Stream.Close().) | |
| Close(Boolean) |
Releases the internal buffers and other resources used by
this AsyncStream and calls ForceFlush().
If closeBaseStream is set to true, the underlying stream is also closed.
Has no effect if the AsyncStream has already been closed.
| |
| CloseBaseStream |
If true, the underlying stream will be closed when Close() is called on
this AsyncStream. If false, the underlying stream will not be closed,
and Close() will only serve to release this AsyncStream's resources.
| |
| CreateObjRef(Type) | Creates an object that contains all the relevant information required to generate a proxy used to communicate with a remote object. (Inherited from MarshalByRefObject.) | |
| CreateWaitHandle() | Obsolete. Allocates a WaitHandle object. (Inherited from Stream.) | |
| EndRead(IAsyncResult) | Waits for the pending asynchronous read to complete. (Inherited from Stream.) | |
| EndWrite(IAsyncResult) | Ends an asynchronous write operation. (Inherited from Stream.) | |
| Equals(Object) | (Inherited from Object.) | |
| Flush() |
If IgnoreFlush is false, flushes any currently buffered output to the underlying stream and then flushes the underlying stream.
(Overrides Stream.Flush().) | |
| ForceFlush() |
Flushes any currently buffered output to the underlying stream and then flushes the underlying stream,
regardless of the value of the IgnoreFlush property.
| |
| GetHashCode() | Serves as a hash function for a particular type. GetHashCode() is suitable for use in hashing algorithms and data structures like a hash table. (Inherited from Object.) | |
| GetLifetimeService() | Retrieves the current lifetime service object that controls the lifetime policy for this instance. (Inherited from MarshalByRefObject.) | |
| GetType() | Gets the Type of the current instance. (Inherited from Object.) | |
| IgnoreFlush |
If true, calls to Flush() will be ignored. This can be useful
if the AsyncStream is wrapped by another stream that flushes
its underlying stream automatically, since avoiding Flush()'s
improves performance. ForceFlush() may still be invoked to
flush the AsyncStream regardless of the IgnoreFlush property.
| |
| InitializeLifetimeService() | Obtains a lifetime service object to control the lifetime policy for this instance. (Inherited from MarshalByRefObject.) | |
| Length |
Returns the length of the stream.
(Overrides Stream.Length.) | |
| MaximumIOSize |
Gets or sets the maximum number of bytes that will be asycnhronously written to or read from the underlying stream at one time.
When reading, this is only the number of bytes requested; BaseStream.Read() is free to return fewer bytes.
This value must be greater than or equal to MinimumIOSize.
| |
| MemberwiseClone(Boolean) | Creates a shallow copy of the current MarshalByRefObject object. (Inherited from MarshalByRefObject.) | |
| MinimumIOSize |
Gets or sets the minimum number of bytes that will be asycnhronously written to or read from the underlying stream.
When reading, this is only the number of bytes requested; BaseStream.Read() is free to return fewer bytes.
This minimum will be violated when fewer than MinimumIOSize bytes remain at the end of the buffer to be filled or flushed.
Higher values may be used to reduce the number of I/O calls made to the underlying stream.
Must be greater than 0 and less than or equal to MaximumIOSize.
| |
| Mode |
Gets or sets the mode (reading or writing) for this AsyncStream.
Manually setting this property is not usually necessary as it will
be done automatically as required by Read(), ReadByte(), Write() and WriteByte()
method invokations.
| |
| Position |
Gets or sets the position in the stream where the next read or write operation will take place.
(Overrides Stream.Position.) | |
| Read(Byte[](), Int32, Int32) |
Reads data into readBuffer from AsyncStream's internal buffers.
If fewer than count bytes are immediately available, only the
bytes presently in the buffer will be returned; the method will block
only if zero bytes are available.
(Overrides Stream.Read(Byte[](), Int32, Int32).) | |
| ReadByte() |
Reads a byte from the AsyncStream.
Will block only if no bytes are currently available in the buffer.
(Overrides Stream.ReadByte().) | |
| ReadTimeout | Gets or sets a value that determines how long the stream will attempt to read before timing out. (Inherited from Stream.) | |
| Seek(Int64, SeekOrigin) |
Sets the position in the stream.
If the underlying stream does not support seeking, a NotSupportedException will be thrown.
(Overrides Stream.Seek(Int64, SeekOrigin).) | |
| SetLength(Int64) |
Sets the length of the stream.
The underlying BaseStream must also support SetLength.
(Overrides Stream.SetLength(Int64).) | |
| ToString() | (Inherited from Object.) | |
| Write(Byte[](), Int32, Int32) |
Writes bytes from the provided writeBuffer into AsyncStream's internal buffers,
from which they will be asynchronously written back to the underlying stream.
If the number of bytes to be written exceeds the capacity of the internal buffers
this method may block while data is flushed to the underlying stream.
(Overrides Stream.Write(Byte[](), Int32, Int32).) | |
| WriteByte(Byte) |
Writes a byte into AsyncStream's internal buffers,
from which it will be asynchronously written back to the underlying stream.
If the internal buffers are full this method may block until one of them can be flushed.
(Overrides Stream.WriteByte(Byte).) | |
| WriteTimeout | Gets or sets a value that determines how long the stream will attempt to write before timing out. (Inherited from Stream.) |
Calls to Read(), ReadByte(), Write() and WriteByte() will only block if there are insufficient bytes available in the buffer. This may occur on the first call immediately after instantiation (when in reading Mode), immediately after switching from writing to reading mode, when trying to write more data than can fit in the buffer, or in general when the stream is being read or written faster than its underlying source or sink permits (e.g. FileStreams for files on local fixed disks are limited by disk transfer rate). To avoid blocking, use Available to get the number of bytes that can be written or read (depending on the mode) without blocking.
AsyncStreams operate by invoking the underlying stream's Read() and Write() methods on a dedicated background thread. If the underlying stream throws an exception during this background I/O, the background thread will stop and a AsynchronousBaseStreamException will be thrown the next time the Position or Mode properties are set or any method is invoked. Similarly, a SynchronousBaseStreamException exception will be immediately thrown if an unanticipated exception is thrown by the underlying stream during a method call or property assignment. In both cases, the original exception will be available via the Asynchronous/SynchronousBaseStreamException's InnerException property.
After an AsynchronousBaseStreamException is thrown, the asynchronous exception will be "forgotten" by the AsyncStream and the next time a method is called or Mode or Position is set the background thread will resume; you may also call ClearAsynchronousException() to forget an asynchronous exception and resume background I/O immediately.
Note: Do not use an AsyncStream to wrap a stream whose Read() or Write() methods may never return (e.g. a NetworkStream with infinite ReadTimeout or WriteTimeout) as this can potentially allow certain AsyncStream methods to also never return or prevent the AsyncStream object from being disposed properly.
| Object | |||
| MarshalByRefObject | |||
| Stream | |||
| AsyncStream | |||