Skip Navigation Links.

UnmanagedMemoryStream Members

The UnmanagedMemoryStream type exposes the following members.

Constructors

  NameDescription
Public methodUnmanagedMemoryStream()()()()
Create a new, empty unmanaged memory stream. The memory stream can be resized by setting Length, calling SetLength(Int64), or writing to the stream.
Public methodUnmanagedMemoryStream(Int64)
Create a new unmanaged memory stream with storage for a certain number of bytes of data. The length of the stream will be set to bytes, but the contents of the stream after initialization are undefined.

Methods

  NameDescription
Public methodBeginRead (Inherited from Stream.)
Public methodBeginWrite (Inherited from Stream.)
Public methodClose (Inherited from Stream.)
Public methodCreateObjRef (Inherited from MarshalByRefObject.)
Protected methodCreateWaitHandle Obsolete. (Inherited from Stream.)
Public methodDispose()()()() (Inherited from Stream.)
Protected methodDispose(Boolean) (Overrides StreamDispose(Boolean).)
Public methodEndRead (Inherited from Stream.)
Public methodEndWrite (Inherited from Stream.)
Public methodEquals (Inherited from Object.)
Protected methodFinalize (Overrides ObjectFinalize()()()().)
Public methodFlush
"Flush" the contents of the stream. This operation does nothing.
(Overrides StreamFlush()()()().)
Public methodGetHashCode (Inherited from Object.)
Public methodGetLifetimeService (Inherited from MarshalByRefObject.)
Public methodGetType (Inherited from Object.)
Public methodInitializeLifetimeService (Inherited from MarshalByRefObject.)
Protected methodMemberwiseClone()()()() (Inherited from Object.)
Protected methodMemberwiseClone(Boolean) (Inherited from MarshalByRefObject.)
Public methodRead
Read count bytes from the current position in the stream, and place them into the buffer starting at the given offset. The position will be updated to the point after the last byte read.
(Overrides StreamRead(array<Byte>[]()[][], Int32, Int32).)
Public methodReadByte (Inherited from Stream.)
Public methodReserve
Reserve a certain amount of space in the buffer, to minimize the need for reallocations if you already know how much space will be needed.
Public methodSeek
Seek to a specific position in the stream.
(Overrides StreamSeek(Int64, SeekOrigin).)
Public methodSetLength
Set the length of the stream. If the new length of the stream is larger than the old length, the contents of the stream from the old length to the new length are undefined.
(Overrides StreamSetLength(Int64).)
Public methodToString (Inherited from Object.)
Public methodWrite
Write data into unmanaged memory. If the write would continue past the end of the memory stream, the memory stream is expanded.
(Overrides StreamWrite(array<Byte>[]()[][], Int32, Int32).)
Public methodWriteByte (Inherited from Stream.)

Properties

  NameDescription
Public propertyBuffer
Retrieve a pointer to the unmanaged memory buffer. Since this buffer is pointing into unmanaged memory, it does not need to be pinned.
Public propertyCanRead
Whether the stream can be read from. Always true.
(Overrides StreamCanRead()()()().)
Public propertyCanSeek
Whether one can seek in the stream. Always true.
(Overrides StreamCanSeek()()()().)
Public propertyCanTimeout (Inherited from Stream.)
Public propertyCanWrite
Whether on can write to the stream. Always true.
(Overrides StreamCanWrite()()()().)
Public propertyCapacity
The amount of space in the unmanaged memory buffer. This can be larger than the length of the stream. If you know how many bytes will be written to the stream, you might want to set the capacity (either via this property or through Reserve(Int64)) large enough to avoid resizing the stream multiple times.
Public propertyLength
The length of the stream, in bytes.
(Overrides StreamLength()()()().)
Public propertyPosition
Reports or sets the position in the stream.
(Overrides StreamPosition()()()().)
Public propertyReadTimeout (Inherited from Stream.)
Public propertyWriteTimeout (Inherited from Stream.)

See Also