Buffer Class |
Namespace: Demo3D.IO
public sealed class Buffer : IOffsetDataReader, IDataReferenceReader, IOffsetDataWriter, IBufferResolver, IDataReferenceWriter, IDataReference, IEquatable<Buffer>, ICloneable
The Buffer type exposes the following members.
| Name | Description | |
|---|---|---|
| Buffer(ArraySegmentByte) |
Creates a new Buffer referencing a subsection of the same underlying memory byte array as the specified pointer.
| |
| Buffer(Byte) |
Creates a new Buffer describing the entire specified byte array.
| |
| Buffer(Int64) |
Creates a new Buffer with a given fixed size.
| |
| Buffer(ArraySegmentByte, Int32, Int32) |
Creates a new Buffer referencing a subsection of the same underlying memory byte array as the specified pointer.
| |
| Buffer(Byte, Int32, Int32) |
Creates a new Buffer.
|
| Name | Description | |
|---|---|---|
| Data |
The underlying memory byte array.
| |
| Empty |
An empty buffer.
| |
| From |
Index into Data of the first byte in the BufferSegment.
| |
| Item |
Indexer
| |
| Length |
The number of bytes being referenced by this BufferSegment.
| |
| To |
Returns the index into Data of the first byte after the BufferSegment.
|
| Name | Description | |
|---|---|---|
| Clone |
Return a copy of the data. The underlying buffer is not shared.
| |
| Equals(Buffer) |
Returns true if the two buffers have the same content.
| |
| Equals(Byte) |
Returns true if the two buffers have the same content.
| |
| Equals(Object) |
Returns true if the two buffers have the same content.
(Overrides ObjectEquals(Object).) | |
| Equals(Byte, Int32, Int32) |
Returns true if length portion of the two buffers have the same content.
| |
| Equals(Int32, Byte, Int32, Int32) |
Returns true if length portion of the two buffers have the same content.
| |
| Equals(Byte, Int32, Byte, Int32, Int32) |
Returns true if length portion of the two buffers have the same content.
| |
| GetHashCode |
Serves has a hash function for the content of the buffer.
(Overrides ObjectGetHashCode.) | |
| GetReferenceT |
Returns a reference to data of type T at offset in the buffer.
| |
| ToByteArray |
Returns a byte array containing the data referenced by this Buffer.
The byte array returned may or may not reference the same memory byte array as this Buffer.
| |
| ToString |
Returns a description of the buffer.
(Overrides ObjectToString.) |
| Name | Description | |
|---|---|---|
| (Buffer to BufferSegment) |
Convert Buffer to BufferSegment.
| |
| (Buffer to ArraySegmentByte) |
Convert Buffer to ArraySegment{byte}.
| |
| (BufferSegment to Buffer) |
Convert BufferSegment to Buffer.
|
| Name | Description | |
|---|---|---|
| ReadBit |
Reads a bit at offset in the buffer.
(Defined by OffsetDataReaderExtensions.) | |
| ReadBoolean |
Reads a boolean at offset in the buffer.
(Defined by OffsetDataReaderExtensions.) | |
| ReadByte |
Reads from the specified offset and returns the data as a value.
(Defined by DataReferenceExtensions.) | |
| ReadBytes(Int32, Int32) | Overloaded.
Reads a number of bytes at offset in the buffer.
(Defined by OffsetDataReaderExtensions.) | |
| ReadBytes(Int32, ArraySegmentByte) | Overloaded.
Reads a number of bytes at offset in the buffer.
(Defined by OffsetDataReaderExtensions.) | |
| ReadBytes(Int32, IDataWriter, Int32) | Overloaded.
Reads a number of bytes at offset in the buffer.
(Defined by OffsetDataReaderExtensions.) | |
| ReadBytes(Int32, Byte, Int32, Int32) | Overloaded.
Reads a number of bytes at offset in the buffer.
(Defined by OffsetDataReaderExtensions.) | |
| ReadChar |
Reads a character at offset in the buffer.
(Defined by OffsetDataReaderExtensions.) | |
| ReadDouble |
Reads a 64bit double floating point number at offset in the buffer.
(Defined by OffsetDataReaderExtensions.) | |
| ReadDoubleBE |
Reads a 64bit double floating point number at offset in the buffer.
(Defined by OffsetDataReaderExtensions.) | |
| ReadDoubleLE |
Reads from the specified offset and returns the data as a value.
(Defined by DataReferenceExtensions.) | |
| ReadInt16 |
Reads a 16bit signed integer at offset in the buffer.
(Defined by OffsetDataReaderExtensions.) | |
| ReadInt16BE |
Reads a 16bit signed integer at offset in the buffer.
(Defined by OffsetDataReaderExtensions.) | |
| ReadInt16LE |
Reads from the specified offset and returns the data as a value.
(Defined by DataReferenceExtensions.) | |
| ReadInt32 |
Reads a 32bit signed integer at offset in the buffer.
(Defined by OffsetDataReaderExtensions.) | |
| ReadInt32BE |
Reads a 32bit signed integer at offset in the buffer.
(Defined by OffsetDataReaderExtensions.) | |
| ReadInt32LE |
Reads the memory exchange from the specified offset and returns the data as a value.
(Defined by DataReferenceExtensions.) | |
| ReadInt64 |
Reads a 64bit signed integer at offset in the buffer.
(Defined by OffsetDataReaderExtensions.) | |
| ReadInt64BE |
Reads a 64bit signed integer at offset in the buffer.
(Defined by OffsetDataReaderExtensions.) | |
| ReadInt64LE |
Reads from the specified offset and returns the data as a value.
(Defined by DataReferenceExtensions.) | |
| ReadSByte |
Reads from the specified offset and returns the data as a value.
(Defined by DataReferenceExtensions.) | |
| ReadSingle |
Reads a 32bit single floating point number at offset in the buffer.
(Defined by OffsetDataReaderExtensions.) | |
| ReadSingleBE |
Reads a 32bit single floating point number at offset in the buffer.
(Defined by OffsetDataReaderExtensions.) | |
| ReadSingleLE |
Reads from the specified offset and returns the data as a value.
(Defined by DataReferenceExtensions.) | |
| ReadString |
Reads a string at offset in the buffer.
(Defined by OffsetDataReaderExtensions.) | |
| ReadUInt16 |
Reads a 16bit unsigned integer at offset in the buffer.
(Defined by OffsetDataReaderExtensions.) | |
| ReadUInt16BE |
Reads a 16bit unsigned integer at offset in the buffer.
(Defined by OffsetDataReaderExtensions.) | |
| ReadUInt16LE |
Reads from the specified offset and returns the data as a value.
(Defined by DataReferenceExtensions.) | |
| ReadUInt32 |
Reads a 32bit unsigned integer at offset in the buffer.
(Defined by OffsetDataReaderExtensions.) | |
| ReadUInt32BE |
Reads a 32bit unsigned integer at offset in the buffer.
(Defined by OffsetDataReaderExtensions.) | |
| ReadUInt32LE |
Reads from the specified offset and returns the data as a value.
(Defined by DataReferenceExtensions.) | |
| ReadUInt64 |
Reads a 64bit unsigned integer at offset in the buffer.
(Defined by OffsetDataReaderExtensions.) | |
| ReadUInt64BE |
Reads a 64bit unsigned integer at offset in the buffer.
(Defined by OffsetDataReaderExtensions.) | |
| ReadUInt64LE |
Reads from the specified offset and returns the data as a value.
(Defined by DataReferenceExtensions.) | |
| WriteAsBit |
Writes a bit at the current position in the buffer.
The object is first converted using BinaryConvert.ChangeType(val, TypeCode.Boolean).
ChangeType(Object, Type, BinaryConvertConversionType)
The current position is advanced by 1 byte.
(Defined by OffsetDataWriterExtensions.) | |
| WriteAsBoolean |
Writes a boolean at the current position in the buffer.
The object is first converted using BinaryConvert.ChangeType(val, TypeCode.Boolean).
ChangeType(Object, Type, BinaryConvertConversionType)
The current position is advanced by 1 byte.
(Defined by OffsetDataWriterExtensions.) | |
| WriteAsByte |
Writes a byte at the current position in the buffer.
The object is first converted using BinaryConvert.ChangeType(val, TypeCode.Byte).
ChangeType(Object, Type, BinaryConvertConversionType)
The current position is advanced by 1 byte.
(Defined by OffsetDataWriterExtensions.) | |
| WriteAsChar |
Writes a character at the current position in the buffer.
The object is first converted using BinaryConvert.ChangeType(val, TypeCode.Char).
ChangeType(Object, Type, BinaryConvertConversionType)
The current position is advanced by 1 byte.
(Defined by OffsetDataWriterExtensions.) | |
| WriteAsDouble |
Writes a 64bit double floating point number at the current position in the buffer.
The object is first converted using BinaryConvert.ChangeType(val, TypeCode.Double).
ChangeType(Object, Type, BinaryConvertConversionType)
The current position is advanced by 8 bytes.
(Defined by OffsetDataWriterExtensions.) | |
| WriteAsDoubleBE |
Writes a 64bit double floating point number at the current position in the buffer.
The object is first converted using BinaryConvert.ChangeType(val, TypeCode.Double).
ChangeType(Object, Type, BinaryConvertConversionType)
The current position is advanced by 8 bytes.
(Defined by OffsetDataWriterExtensions.) | |
| WriteAsDoubleLE |
Writes a 64bit double floating point number at the current position in the buffer.
The object is first converted using BinaryConvert.ChangeType(val, TypeCode.Double).
ChangeType(Object, Type, BinaryConvertConversionType)
The current position is advanced by 8 bytes.
(Defined by OffsetDataWriterExtensions.) | |
| WriteAsInt16 |
Writes a 16bit signed integer at the current position in the buffer.
The object is first converted using BinaryConvert.ChangeType(val, TypeCode.Int16).
ChangeType(Object, Type, BinaryConvertConversionType)
The current position is advanced by 2 bytes.
(Defined by OffsetDataWriterExtensions.) | |
| WriteAsInt16BE |
Writes a 16bit signed integer at the current position in the buffer.
The object is first converted using BinaryConvert.ChangeType(val, TypeCode.Int16).
ChangeType(Object, Type, BinaryConvertConversionType)
The current position is advanced by 2 bytes.
(Defined by OffsetDataWriterExtensions.) | |
| WriteAsInt16LE |
Writes a 16bit signed integer at the current position in the buffer.
The object is first converted using BinaryConvert.ChangeType(val, TypeCode.Int16).
ChangeType(Object, Type, BinaryConvertConversionType)
The current position is advanced by 2 bytes.
(Defined by OffsetDataWriterExtensions.) | |
| WriteAsInt32 |
Writes a 32bit signed integer at the current position in the buffer.
The object is first converted using BinaryConvert.ChangeType(val, TypeCode.Int32).
ChangeType(Object, Type, BinaryConvertConversionType)
The current position is advanced by 4 bytes.
(Defined by OffsetDataWriterExtensions.) | |
| WriteAsInt32BE |
Writes a 32bit signed integer at the current position in the buffer.
The object is first converted using BinaryConvert.ChangeType(val, TypeCode.Int32).
ChangeType(Object, Type, BinaryConvertConversionType)
The current position is advanced by 4 bytes.
(Defined by OffsetDataWriterExtensions.) | |
| WriteAsInt32LE |
Writes a 32bit signed integer at the current position in the buffer.
The object is first converted using BinaryConvert.ChangeType(val, TypeCode.Int32).
ChangeType(Object, Type, BinaryConvertConversionType)
The current position is advanced by 4 bytes.
(Defined by OffsetDataWriterExtensions.) | |
| WriteAsInt64 |
Writes a 64bit signed integer at the current position in the buffer.
The object is first converted using BinaryConvert.ChangeType(val, TypeCode.Int64).
ChangeType(Object, Type, BinaryConvertConversionType)
The current position is advanced by 8 bytes.
(Defined by OffsetDataWriterExtensions.) | |
| WriteAsInt64BE |
Writes a 64bit signed integer at the current position in the buffer.
The object is first converted using BinaryConvert.ChangeType(val, TypeCode.Int64).
ChangeType(Object, Type, BinaryConvertConversionType)
The current position is advanced by 8 bytes.
(Defined by OffsetDataWriterExtensions.) | |
| WriteAsInt64LE |
Writes a 64bit signed integer at the current position in the buffer.
The object is first converted using BinaryConvert.ChangeType(val, TypeCode.Int64).
ChangeType(Object, Type, BinaryConvertConversionType)
The current position is advanced by 8 bytes.
(Defined by OffsetDataWriterExtensions.) | |
| WriteAsSByte |
Writes a signed byte at the current position in the buffer.
The object is first converted using BinaryConvert.ChangeType(val, TypeCode.SByte).
ChangeType(Object, Type, BinaryConvertConversionType)
The current position is advanced by 1 byte.
(Defined by OffsetDataWriterExtensions.) | |
| WriteAsSingle |
Writes a 32bit single floating point number at the current position in the buffer.
The object is first converted using BinaryConvert.ChangeType(val, TypeCode.Single).
ChangeType(Object, Type, BinaryConvertConversionType)
The current position is advanced by 4 bytes.
(Defined by OffsetDataWriterExtensions.) | |
| WriteAsSingleBE |
Writes a 32bit single floating point number at the current position in the buffer.
The object is first converted using BinaryConvert.ChangeType(val, TypeCode.Single).
ChangeType(Object, Type, BinaryConvertConversionType)
The current position is advanced by 4 bytes.
(Defined by OffsetDataWriterExtensions.) | |
| WriteAsSingleLE |
Writes a 32bit single floating point number at the current position in the buffer.
The object is first converted using BinaryConvert.ChangeType(val, TypeCode.Single).
ChangeType(Object, Type, BinaryConvertConversionType)
The current position is advanced by 4 bytes.
(Defined by OffsetDataWriterExtensions.) | |
| WriteAsString |
Writes a string at the current position in the buffer.
The current position is advanced by the number of bytes written.
(Defined by OffsetDataWriterExtensions.) | |
| WriteAsUInt16 |
Writes a 16bit unsigned integer at the current position in the buffer.
The object is first converted using BinaryConvert.ChangeType(val, TypeCode.UInt16).
ChangeType(Object, Type, BinaryConvertConversionType)
The current position is advanced by 2 bytes.
(Defined by OffsetDataWriterExtensions.) | |
| WriteAsUInt16BE |
Writes a 16bit unsigned integer at the current position in the buffer.
The object is first converted using BinaryConvert.ChangeType(val, TypeCode.UInt16).
ChangeType(Object, Type, BinaryConvertConversionType)
The current position is advanced by 2 bytes.
(Defined by OffsetDataWriterExtensions.) | |
| WriteAsUInt16LE |
Writes a 16bit unsigned integer at the current position in the buffer.
The object is first converted using BinaryConvert.ChangeType(val, TypeCode.UInt16).
ChangeType(Object, Type, BinaryConvertConversionType)
The current position is advanced by 2 bytes.
(Defined by OffsetDataWriterExtensions.) | |
| WriteAsUInt32 |
Writes a 32bit unsigned integer at the current position in the buffer.
The object is first converted using BinaryConvert.ChangeType(val, TypeCode.UInt32).
ChangeType(Object, Type, BinaryConvertConversionType)
The current position is advanced by 4 bytes.
(Defined by OffsetDataWriterExtensions.) | |
| WriteAsUInt32BE |
Writes a 32bit unsigned integer at the current position in the buffer.
The object is first converted using BinaryConvert.ChangeType(val, TypeCode.UInt32).
ChangeType(Object, Type, BinaryConvertConversionType)
The current position is advanced by 4 bytes.
(Defined by OffsetDataWriterExtensions.) | |
| WriteAsUInt32LE |
Writes a 32bit unsigned integer at the current position in the buffer.
The object is first converted using BinaryConvert.ChangeType(val, TypeCode.UInt32).
ChangeType(Object, Type, BinaryConvertConversionType)
The current position is advanced by 4 bytes.
(Defined by OffsetDataWriterExtensions.) | |
| WriteAsUInt64 |
Writes a 64bit unsigned integer at the current position in the buffer.
The object is first converted using BinaryConvert.ChangeType(val, TypeCode.UInt64).
ChangeType(Object, Type, BinaryConvertConversionType)
The current position is advanced by 8 bytes.
(Defined by OffsetDataWriterExtensions.) | |
| WriteAsUInt64BE |
Writes a 64bit unsigned integer at the current position in the buffer.
The object is first converted using BinaryConvert.ChangeType(val, TypeCode.UInt64).
ChangeType(Object, Type, BinaryConvertConversionType)
The current position is advanced by 8 bytes.
(Defined by OffsetDataWriterExtensions.) | |
| WriteAsUInt64LE |
Writes a 64bit unsigned integer at the current position in the buffer.
The object is first converted using BinaryConvert.ChangeType(val, TypeCode.UInt64).
ChangeType(Object, Type, BinaryConvertConversionType)
The current position is advanced by 8 bytes.
(Defined by OffsetDataWriterExtensions.) | |
| WriteBit |
Writes a bit at offset in the buffer.
(Defined by OffsetDataWriterExtensions.) | |
| WriteBoolean |
Writes a boolean at offset in the buffer.
(Defined by OffsetDataWriterExtensions.) | |
| WriteByte |
Write a value at the specified offset.
(Defined by DataReferenceExtensions.) | |
| WriteBytes(Int32, ArraySegmentByte) | Overloaded.
Writes a bytes at offset in the data.
(Defined by OffsetDataWriterExtensions.) | |
| WriteBytes(Int32, Byte) | Overloaded.
Writes a bytes at offset in the data.
(Defined by OffsetDataWriterExtensions.) | |
| WriteBytes(Int32, ArraySegmentByte, Int32) | Overloaded.
Writes a bytes at offset in the data.
(Defined by OffsetDataWriterExtensions.) | |
| WriteBytes(Int32, Byte, Int32, Int32) | Overloaded.
Writes a bytes at offset in the data.
(Defined by OffsetDataWriterExtensions.) | |
| WriteChar |
Writes an 8bit character at offset in the buffer.
(Defined by OffsetDataWriterExtensions.) | |
| WriteDouble |
Writes a double floating point number at offset in the buffer.
(Defined by OffsetDataWriterExtensions.) | |
| WriteDoubleBE |
Writes a double floating point number at offset in the buffer.
(Defined by OffsetDataWriterExtensions.) | |
| WriteDoubleLE |
Write a value at the specified offset.
(Defined by DataReferenceExtensions.) | |
| WriteInt16 |
Writes a 16bit signed integer at offset in the buffer.
(Defined by OffsetDataWriterExtensions.) | |
| WriteInt16BE |
Writes a 16bit signed integer at offset in the buffer.
(Defined by OffsetDataWriterExtensions.) | |
| WriteInt16LE |
Write a value at the specified offset.
(Defined by DataReferenceExtensions.) | |
| WriteInt32 |
Writes a 32bit signed integer at offset in the buffer.
(Defined by OffsetDataWriterExtensions.) | |
| WriteInt32BE |
Writes a 32bit signed integer at offset in the buffer.
(Defined by OffsetDataWriterExtensions.) | |
| WriteInt32LE |
Write a value at the specified offset.
(Defined by DataReferenceExtensions.) | |
| WriteInt64 |
Writes a 64bit signed integer at offset in the buffer.
(Defined by OffsetDataWriterExtensions.) | |
| WriteInt64BE |
Writes a 64bit signed integer at offset in the buffer.
(Defined by OffsetDataWriterExtensions.) | |
| WriteInt64LE |
Write a value at the specified offset.
(Defined by DataReferenceExtensions.) | |
| WriteSByte |
Write a value at the specified offset.
(Defined by DataReferenceExtensions.) | |
| WriteSingle |
Writes a single floating point number at offset in the buffer.
(Defined by OffsetDataWriterExtensions.) | |
| WriteSingleBE |
Writes a single floating point number at offset in the buffer.
(Defined by OffsetDataWriterExtensions.) | |
| WriteSingleLE |
Write a value at the specified offset.
(Defined by DataReferenceExtensions.) | |
| WriteString |
Writes a string at offset in the buffer.
(Defined by OffsetDataWriterExtensions.) | |
| WriteUInt16 |
Writes a 16bit unsigned integer at offset in the buffer.
(Defined by OffsetDataWriterExtensions.) | |
| WriteUInt16BE |
Writes a 16bit unsigned integer at offset in the buffer.
(Defined by OffsetDataWriterExtensions.) | |
| WriteUInt16LE |
Write a value at the specified offset.
(Defined by DataReferenceExtensions.) | |
| WriteUInt32 |
Writes a 32bit unsigned integer at offset in the buffer.
(Defined by OffsetDataWriterExtensions.) | |
| WriteUInt32BE |
Writes a 32bit unsigned integer at offset in the buffer.
(Defined by OffsetDataWriterExtensions.) | |
| WriteUInt32LE |
Write a value at the specified offset.
(Defined by DataReferenceExtensions.) | |
| WriteUInt64 |
Writes a 64bit unsigned integer at offset in the buffer.
(Defined by OffsetDataWriterExtensions.) | |
| WriteUInt64BE |
Writes a 64bit unsigned integer at offset in the buffer.
(Defined by OffsetDataWriterExtensions.) | |
| WriteUInt64LE |
Write a value at the specified offset.
(Defined by DataReferenceExtensions.) |