[]
        
(Showing Draft Content)

C1.Util.DX.DataStream

DataStream Class

Provides a stream interface to a buffer located in unmanaged memory.

Inheritance
DataStream
Implements
Namespace: C1.Util.DX
Assembly: C1.Win.C1DX.4.8.dll
Syntax
public class DataStream : Stream, IDisposable

Constructors

Name Description
DataStream(DataPointer)

Initializes a new instance of the DataStream class.

DataStream(Blob)

Initializes a new instance of the DataStream class from a Blob buffer.

DataStream(int, bool, bool)

Initializes a new instance of the DataStream class, and allocates a new buffer to use as a backing store.

DataStream(IntPtr, long, bool, bool)

Initializes a new instance of the DataStream class, using an unmanaged buffer as a backing store.

Properties

Name Description
CanRead

Gets a value indicating whether the current stream supports reading.

CanSeek

Gets a value indicating whether the current stream supports seeking.

CanWrite

Gets a value indicating whether the current stream supports writing.

DataPointer

Gets the internal pointer to the current stream's backing store.

Length

Gets the length in bytes of the stream.

Position

Gets or sets the position within the current stream.

PositionPointer

Gets the position pointer.

RemainingLength

Gets the length of the remaining.

Methods

Name Description
Create<T>(T[], bool, bool, int, bool)

Initializes a new instance of the DataStream class, using a managed buffer as a backing store.

Dispose(bool)

Releases unmanaged and - optionally - managed resources

Flush()

Not supported.

Read(byte[], int, int)

Reads a sequence of bytes from the current stream and advances the position within the stream by the number of bytes read.

Read(IntPtr, int, int)

Reads a sequence of bytes from the current stream and advances the current position within this stream by the number of bytes written.

ReadBoolean()

Reads a bool.

ReadByte()
ReadColorF()

Reads a ColorF.

ReadFloat()

Reads a float.

ReadInt()

Reads a int.

ReadMatrix4x4()

Reads a Matrix.

ReadRange<T>(int)

Reads an array of values from the current stream, and advances the current position within this stream by the number of bytes written.

ReadRange<T>(T[], int, int)

Reads a sequence of elements from the current stream into a target buffer and advances the position within the stream by the number of bytes read.

ReadShort()

Reads a short.

ReadVector2()

Reads a Vector2.

ReadVector3()

Reads a Vector3.

ReadVector4()

Reads a Vector4.

Read<T>()

Reads a single value from the current stream and advances the current position within this stream by the number of bytes read.

Seek(long, SeekOrigin)

Sets the position within the current stream.

SetLength(long)

Not supported.

Write(ColorF)

Writes the specified value.

Write(Matrix4x4)

Writes the specified value.

Write(Vector2)

Writes the specified value.

Write(Vector3)

Writes the specified value.

Write(Vector4)

Writes the specified value.

Write(bool)

Writes the specified value.

Write(byte[], int, int)

Writes a sequence of bytes to the current stream and advances the current position within this stream by the number of bytes written.

Write(short)

Writes the specified value.

Write(int)

Writes the specified value.

Write(IntPtr, 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.

Write(float)

Writes the specified value.

WriteRange(IntPtr, long)

Writes a range of bytes to the current stream, and advances the current position within this stream by the number of bytes written.

WriteRange<T>(T[])

Writes an array of values to the current stream, and advances the current position within this stream by the number of bytes written.

WriteRange<T>(T[], int, int)

Writes an array of values to the current stream, and advances the current position within this stream by the number of bytes written.

Write<T>(T)

Writes a single value to the stream, and advances the current position within this stream by the number of bytes written.

Operators

Name Description
implicit operator DataPointer(DataStream)

Performs an explicit conversion from DataStream to DataPointer.