OptimizedMemoryStream

OptimizedMemoryStream class

Defines a MemoryStream that can contains more standard capacity

public class OptimizedMemoryStream : Stream

Constructors

Name Description
OptimizedMemoryStream() Initializes a new instance of the OptimizedMemoryStream class.
OptimizedMemoryStream(byte[]) Initializes a new instance of the OptimizedMemoryStream class based on the specified byte array.
OptimizedMemoryStream(int) Initializes a new instance of the OptimizedMemoryStream class.
OptimizedMemoryStream(int, byte[]) Initializes a new instance of the OptimizedMemoryStream class based on the specified byte array.

Properties

Name Description
BufferSize { get; set; } Gets or sets the size of the underlying buffers.
override CanRead { get; } When overridden in a derived class, gets a value indicating whether the current stream supports reading.
override CanSeek { get; } When overridden in a derived class, gets a value indicating whether the current stream supports seeking.
override CanWrite { get; } When overridden in a derived class, gets a value indicating whether the current stream supports writing.
FreeOnDispose { get; set; } Gets or sets a value indicating whether to free the underlying buffers on dispose.
override Length { get; } When overridden in a derived class, gets the length in bytes of the stream.
override Position { get; set; } When overridden in a derived class, gets or sets the position within the current stream.

Methods

Name Description
override Flush() The function overrided.
override Read(byte[], int, int) When overridden in a derived class, reads a sequence of bytes from the current stream and advances the position within the stream by the number of bytes read.
override ReadByte() Reads 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.
override Seek(long, SeekOrigin) When overridden in a derived class, sets the position within the current stream.
override SetLength(long) When overridden in a derived class, sets the length of the current stream.
ToArray() Converts the current stream to a byte array.
override Write(byte[], int, int) When overridden in a derived class, writes a sequence of bytes to the current stream and advances the current position within this stream by the number of bytes written.
override WriteByte(byte) Writes a byte to the current position in the stream and advances the position within the stream by one byte.
WriteTo(Stream) Writes to the specified stream.

Fields

Name Description
const DefaultBufferSize Default buffer size value in bytes.

See Also