Was this page helpful?

ChunkedMemoryStream Class

    Table of contents
    1. 1. Members
      1. 1.1. Constructors
      2. 1.2. Properties
      3. 1.3. Methods
    Table of Contents
    public class ChunkedMemoryStream
    Namespace: MindTouch.IO
    Assembly: mindtouch.dream
    Type Hierarchy:
    • object
      • MarshalByRefObject
        • Stream
          • ChunkedMemoryStream
    Implements:
    • IDisposable
    Provides an altnerate implementation of System.IO.MemoryStream that keeps its internal data buffers in several chunks to avoid memory fragmenation.

    Members

    Constructors

    Visibility Description
    Public ChunkedMemoryStream() Create a writeable and resizable memory stream
    Public ChunkedMemoryStream(int capacity) Create a writeable and resizable memory stream with an initial capacity
    Public ChunkedMemoryStream(Byte[] buffer) Initializes a new non-resizable instance based on the specified byte array.
    Public ChunkedMemoryStream(Byte[] buffer, bool writable) Initializes a new non-resizable instance based on the specified byte array with the ChunkedMemoryStream.CanWrite property set as specified.
    Public ChunkedMemoryStream(Byte[] buffer, int index, int count) Initializes a new non-resizable instance based on the specified region (index) of a byte array.
    Public ChunkedMemoryStream(Byte[] buffer, int index, int count, bool writable) Initializes a new instance based on the specified region of a byte array, with the ChunkedMemoryStream.CanWrite property set as specified, and the ability to call ChunkedMemoryStream.GetBuffer() set as specified.
    Public ChunkedMemoryStream(Byte[] buffer, int index, int count, bool writable, bool publiclyVisible) Initializes a new instance based on the specified region of a byte array, with the ChunkedMemoryStream.CanWrite property set as specified, and the ability to call ChunkedMemoryStream.GetBuffer() set as specified.

    Properties

    Visibility Description
    Public CanRead (Override) True if the stream is not closed.
    Public CanSeek (Override) True if the stream is not closed.
    Public CanWrite (Override) True if the stream is not closed and isn't a read-only stream.
    Public Capacity Change the capacity of the stream. If the stream was created from a byte array, this will throw System.NotSupportedException.
    Public Length (Override) Length of stream.
    Public Position (Override) Current position in the stream.
    Public CanTimeout (Inherited from Stream)
    Public ReadTimeout (Inherited from Stream)
    Public WriteTimeout (Inherited from Stream)

    Methods

    Visibility Description
    Public Flush() (Override) This override of Stream.Flush() is a no-op, except for the case that the stream has been closed in which case it will throw an System.ObjectDisposedException.
    Public GetBuffer() Retrieve the internal chunked buffer representation as a single byte array. Only works if buffer was created with publicly visible option, otherwise throws System.UnauthorizedAccessException.
    Public Read(Byte[] buffer, int offset, int count) (Override) Reads a sequence of bytes from the current stream and advances the position within the stream by the number of bytes read.
    Public Seek(long offset, SeekOrigin origin) (Override) Sets the position within the current stream.
    Public SetLength(long value) (Override) Sets the length of the current stream.
    Public ToArray() Similar to GetBuffer, but creates its output by reading from the internal representation, rather than consolidating the chunks into a single buffer first.
    Public Write(Byte[] buffer, int offset, int count) (Override) Writes a sequence of bytes to the current stream and advances the current position within this stream by the number of bytes written.
    Public WriteTo(Stream stream) Write the entire memory stream to another stream.
    Protected Dispose(bool disposing) (Override) Dispose of the stream's held resource and call the base class Stream.Dispose(bool disposing).
    Public Close() (Inherited from Stream)
    Public Dispose() (Inherited from Stream)
    Protected CreateWaitHandle() (Inherited from Stream)
    Public BeginRead(Byte[] buffer, int offset, int count, AsyncCallback callback, object state) (Inherited from Stream)
    Public EndRead(IAsyncResult asyncResult) (Inherited from Stream)
    Public BeginWrite(Byte[] buffer, int offset, int count, AsyncCallback callback, object state) (Inherited from Stream)
    Public EndWrite(IAsyncResult asyncResult) (Inherited from Stream)
    Public ReadByte() (Inherited from Stream)
    Public WriteByte(byte value) (Inherited from Stream)
    Protected MemberwiseClone(bool cloneIdentity) (Inherited from MarshalByRefObject)
    Public GetLifetimeService() (Inherited from MarshalByRefObject)
    Public InitializeLifetimeService() (Inherited from MarshalByRefObject)
    Public CreateObjRef(Type requestedType) (Inherited from MarshalByRefObject)
    Public ToString() (Inherited from Object)
    Public Equals(object obj) (Inherited from Object)
    Public GetHashCode() (Inherited from Object)
    Public GetType() (Inherited from Object)
    Protected MemberwiseClone() (Inherited from Object)
    Was this page helpful?
    Tag page
    You must login to post a comment.

    Copyright © 2011 MindTouch, Inc. Powered by