Click or drag to resize

BBStream Class

Stream wrapper which adds ability to flush and check for available data on all streams which need to be accessed. Also adds ability to have a timeout on stream read and writes without the underlying connection closing on failure
Inheritance Hierarchy
SystemObject
  SystemMarshalByRefObject
    System.IOStream
      Brainboxes.IOBBStream

Namespace: Brainboxes.IO
Assembly: Brainboxes.IO (in Brainboxes.IO.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
public abstract class BBStream : Stream

The BBStream type exposes the following members.

Properties
 NameDescription
Public propertyBaseStream the underlying stream
Public propertyCanRead Indicates whether the current stream supports reading
(Overrides StreamCanRead)
Public propertyCanSeek Indicates whether the current stream supports seeking
(Overrides StreamCanSeek)
Public propertyCanTimeoutGets a value that determines whether the current stream can time out.
(Inherited from Stream)
Public propertyCanWrite Indicates whether the current stream supports writing
(Overrides StreamCanWrite)
Public propertyDataAvailable Indicates whether data is available, can be 0, for no data, 1 for 1 or more bytes, or a number representing the precise number of bytes
Public propertyLength Gets the length in bytes of the stream
(Overrides StreamLength)
Public propertyPosition Gets or sets the position within the current stream
(Overrides StreamPosition)
Public propertyReadTimeout Read timeout for BBStream
(Overrides StreamReadTimeout)
Public propertyWriteTimeout Write timeout for BBStream
(Overrides StreamWriteTimeout)
Top
Methods
 NameDescription
Public methodBeginReadBegins an asynchronous read operation. (Consider using ReadAsync(Byte, Int32, Int32) instead; see the Remarks section.)
(Inherited from Stream)
Public methodBeginWriteBegins an asynchronous write operation. (Consider using WriteAsync(Byte, Int32, Int32) instead; see the Remarks section.)
(Inherited from Stream)
Public methodCloseCloses the current stream and releases any resources (such as sockets and file handles) associated with the current stream. Instead of calling this method, ensure that the stream is properly disposed.
(Inherited from Stream)
Public methodCopyTo(Stream)Reads the bytes from the current stream and writes them to another stream.
(Inherited from Stream)
Public methodCopyTo(Stream, Int32)Reads the bytes from the current stream and writes them to another stream, using a specified buffer size.
(Inherited from Stream)
Public methodCopyToAsync(Stream)Asynchronously reads the bytes from the current stream and writes them to another stream.
(Inherited from Stream)
Public methodCopyToAsync(Stream, Int32)Asynchronously reads the bytes from the current stream and writes them to another stream, using a specified buffer size.
(Inherited from Stream)
Public methodCopyToAsync(Stream, Int32, CancellationToken)Asynchronously reads the bytes from the current stream and writes them to another stream, using a specified buffer size and cancellation token.
(Inherited from Stream)
Public methodCreateObjRefCreates an object that contains all the relevant information required to generate a proxy used to communicate with a remote object.
(Inherited from MarshalByRefObject)
Public methodDisposeReleases all resources used by the Stream.
(Inherited from Stream)
Public methodEndReadWaits for the pending asynchronous read to complete. (Consider using ReadAsync(Byte, Int32, Int32) instead; see the Remarks section.)
(Inherited from Stream)
Public methodEndWriteEnds an asynchronous write operation. (Consider using WriteAsync(Byte, Int32, Int32) instead; see the Remarks section.)
(Inherited from Stream)
Public methodEqualsDetermines whether the specified object is equal to the current object.
(Inherited from Object)
Public methodFlush Clear the read and write streams
(Overrides StreamFlush)
Public methodFlushAsyncAsynchronously clears all buffers for this stream and causes any buffered data to be written to the underlying device.
(Inherited from Stream)
Public methodFlushAsync(CancellationToken)Asynchronously clears all buffers for this stream, causes any buffered data to be written to the underlying device, and monitors cancellation requests.
(Inherited from Stream)
Public methodGetHashCodeServes as the default hash function.
(Inherited from Object)
Public methodGetLifetimeServiceRetrieves the current lifetime service object that controls the lifetime policy for this instance.
(Inherited from MarshalByRefObject)
Public methodGetTypeGets the Type of the current instance.
(Inherited from Object)
Public methodInitializeLifetimeServiceObtains a lifetime service object to control the lifetime policy for this instance.
(Inherited from MarshalByRefObject)
Public methodRead Read from stream
(Overrides StreamRead(Byte, Int32, Int32))
Public methodReadAsync(Byte, Int32, Int32)Asynchronously reads a sequence of bytes from the current stream and advances the position within the stream by the number of bytes read.
(Inherited from Stream)
Public methodReadAsync(Byte, Int32, Int32, CancellationToken)Asynchronously reads a sequence of bytes from the current stream, advances the position within the stream by the number of bytes read, and monitors cancellation requests.
(Inherited from Stream)
Public methodReadByteReads a byte from the stream and advances the position within the stream by one byte, or returns -1 if at the end of the stream.
(Inherited from Stream)
Public methodSeek Sets the position within the stream
(Overrides StreamSeek(Int64, SeekOrigin))
Public methodSetLength Sets the length of the current stream
(Overrides StreamSetLength(Int64))
Public methodToStringReturns a string that represents the current object.
(Inherited from Object)
Public methodWrite Write to stream
(Overrides StreamWrite(Byte, Int32, Int32))
Public methodWriteAsync(Byte, Int32, Int32)Asynchronously writes a sequence of bytes to the current stream and advances the current position within this stream by the number of bytes written.
(Inherited from Stream)
Public methodWriteAsync(Byte, Int32, Int32, CancellationToken)Asynchronously writes a sequence of bytes to the current stream, advances the current position within this stream by the number of bytes written, and monitors cancellation requests.
(Inherited from Stream)
Public methodWriteByteWrites a byte to the current position in the stream and advances the position within the stream by one byte.
(Inherited from Stream)
Top
See Also