Click or drag to resize

Buffer Class

Represents a pointer into a memory buffer.
Inheritance Hierarchy
SystemObject
  Demo3D.IOBuffer

Namespace:  Demo3D.IO
Assembly:  Demo3D.IO (in Demo3D.IO.dll) Version: 10.0.0.0 (10.0.0.0)
Syntax
C#
public sealed class Buffer : IOffsetDataReader, 
	IOffsetDataWriter, IEquatable<Buffer>, ICloneable

The Buffer type exposes the following members.

Constructors
  NameDescription
Public methodBuffer(Byte)
Creates a new Buffer describing the entire specified byte array.
Public methodBuffer(Int32)
Creates a new Buffer with a given fixed size.
Public methodBuffer(Buffer)
Creates a new Buffer referencing the same underlying memory byte array as the specified pointer.
Public methodBuffer(Byte, Int32, Int32)
Creates a new Buffer.
Public methodBuffer(Buffer, Int32, Int32)
Creates a new Buffer referencing a subsection of the same underlying memory byte array as the specified pointer.
Top
Properties
  NameDescription
Public propertyData
The underlying memory byte array.
Public propertyFrom
Index into Data of the first byte in the Buffer.
Public propertyItem
Indexer
Public propertyLength
The number of bytes being referenced by this Buffer.
Public propertyTo
Returns the index into Data of the first byte after the Buffer.
Top
Methods
  NameDescription
Public methodClone
Return a copy of the data. The underlying buffer is not shared.
Public methodEquals(Byte)
Returns true if the two buffers have the same content.
Public methodEquals(Object)
Returns true if the two buffers have the same content.
(Overrides ObjectEquals(Object).)
Public methodEquals(Buffer)
Returns true if the two buffers have the same content.
Public methodEquals(Byte, Int32, Int32)
Returns true if length portion of the two buffers have the same content.
Public methodEquals(Int32, Byte, Int32, Int32)
Returns true if length portion of the two buffers have the same content.
Public methodStatic memberEquals(Byte, Int32, Byte, Int32, Int32)
Returns true if length portion of the two buffers have the same content.
Public methodGetHashCode
Serves has a hash function for the content of the buffer.
(Overrides ObjectGetHashCode.)
Public methodReadBit
Reads a bit at offset in the buffer.
Public methodReadBoolean
Reads a boolean at offset in the buffer.
Public methodReadByte
Reads a byte at offset in the buffer.
Public methodReadBytes(Int32, Buffer)
Reads a number of bytes at offset in the buffer.
Public methodReadBytes(Int32, Int32)
Reads a number of bytes at offset in the data.
Public methodReadChar
Reads a character at offset in the buffer.
Public methodReadDouble
Reads a 64bit double floating point number at offset in the buffer.
Public methodReadDoubleBE
Reads a 64bit double floating point number at offset in the buffer.
Public methodReadDoubleLE
Reads a 64bit double floating point number at offset in the buffer.
Public methodReadInt16
Reads a 16bit signed integer at offset in the buffer.
Public methodReadInt16BE
Reads a 16bit signed integer at offset in the buffer.
Public methodReadInt16LE
Reads a 16bit signed integer at offset in the buffer.
Public methodReadInt32
Reads a 32bit signed integer at offset in the buffer.
Public methodReadInt32BE
Reads a 32bit signed integer at offset in the buffer.
Public methodReadInt32LE
Reads a 32bit signed integer at offset in the buffer.
Public methodReadInt64
Reads a 64bit signed integer at offset in the buffer.
Public methodReadInt64BE
Reads a 64bit signed integer at offset in the buffer.
Public methodReadInt64LE
Reads a 64bit signed integer at offset in the buffer.
Public methodReadSByte
Reads a signed byte at offset in the buffer.
Public methodReadSingle
Reads a 32bit single floating point number at offset in the buffer.
Public methodReadSingleBE
Reads a 32bit single floating point number at offset in the buffer.
Public methodReadSingleLE
Reads a 32bit single floating point number at offset in the buffer.
Public methodReadString
Reads a string at offset in the buffer.
Public methodReadUInt16
Reads a 16bit unsigned integer at offset in the buffer.
Public methodReadUInt16BE
Reads a 16bit unsigned integer at offset in the buffer.
Public methodReadUInt16LE
Reads a 16bit unsigned integer at offset in the buffer.
Public methodReadUInt32
Reads a 32bit unsigned integer at offset in the buffer.
Public methodReadUInt32BE
Reads a 32bit unsigned integer at offset in the buffer.
Public methodReadUInt32LE
Reads a 32bit unsigned integer at offset in the buffer.
Public methodReadUInt64
Reads a 64bit unsigned integer at offset in the buffer.
Public methodReadUInt64BE
Reads a 64bit unsigned integer at offset in the buffer.
Public methodReadUInt64LE
Reads a 64bit unsigned integer at offset in the buffer.
Public methodToByteArray
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.
Public methodToString
Returns a description of the buffer.
(Overrides ObjectToString.)
Public methodWriteBit
Writes a bit at offset in the buffer.
Public methodWriteBoolean
Writes a boolean at offset in the buffer.
Public methodWriteByte
Writes a byte at offset in the buffer.
Public methodWriteBytes(Int32, Buffer)
Writes a bytes at offset in the packet.
Public methodWriteBytes(Int32, Byte)
Writes a bytes at offset in the data.
Public methodWriteChar
Writes an 8bit character at offset in the buffer.
Public methodWriteDouble
Writes a double floating point number at offset in the buffer.
Public methodWriteDoubleBE
Writes a double floating point number at offset in the buffer.
Public methodWriteDoubleLE
Writes a double floating point number at offset in the buffer.
Public methodWriteInt16
Writes a 16bit signed integer at offset in the buffer.
Public methodWriteInt16BE
Writes a 16bit signed integer at offset in the buffer.
Public methodWriteInt16LE
Writes a 16bit signed integer at offset in the buffer.
Public methodWriteInt32
Writes a 32bit signed integer at offset in the buffer.
Public methodWriteInt32BE
Writes a 32bit signed integer at offset in the buffer.
Public methodWriteInt32LE
Writes a 32bit signed integer at offset in the buffer.
Public methodWriteInt64
Writes a 64bit signed integer at offset in the buffer.
Public methodWriteInt64BE
Writes a 64bit signed integer at offset in the buffer.
Public methodWriteInt64LE
Writes a 64bit signed integer at offset in the buffer.
Public methodWriteSByte
Writes a signed byte at offset in the buffer.
Public methodWriteSingle
Writes a single floating point number at offset in the buffer.
Public methodWriteSingleBE
Writes a single floating point number at offset in the buffer.
Public methodWriteSingleLE
Writes a single floating point number at offset in the buffer.
Public methodWriteString
Writes a string at offset in the buffer.
Public methodWriteUInt16
Writes a 16bit unsigned integer at offset in the buffer.
Public methodWriteUInt16BE
Writes a 16bit unsigned integer at offset in the buffer.
Public methodWriteUInt16LE
Writes a 16bit unsigned integer at offset in the buffer.
Public methodWriteUInt32
Writes a 32bit unsigned integer at offset in the buffer.
Public methodWriteUInt32BE
Writes a 32bit unsigned integer at offset in the buffer.
Public methodWriteUInt32LE
Writes a 32bit unsigned integer at offset in the buffer.
Public methodWriteUInt64
Writes a 64bit unsigned integer at offset in the buffer.
Public methodWriteUInt64BE
Writes a 64bit unsigned integer at offset in the buffer.
Public methodWriteUInt64LE
Writes a 64bit unsigned integer at offset in the buffer.
Top
Fields
  NameDescription
Public fieldStatic memberEmpty
An empty buffer.
Top
Extension Methods
  NameDescription
Public Extension MethodWriteAsBit
Writes a bit at the current position in the packet packet. 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 OffsetDataWriter.)
Public Extension MethodWriteAsBoolean
Writes a boolean at the current position in the packet packet. 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 OffsetDataWriter.)
Public Extension MethodWriteAsByte
Writes a byte at the current position in the packet packet. 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 OffsetDataWriter.)
Public Extension MethodWriteAsChar
Writes a character at the current position in the packet packet. 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 OffsetDataWriter.)
Public Extension MethodWriteAsDouble
Writes a 64bit double floating point number at the current position in the packet packet. 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 OffsetDataWriter.)
Public Extension MethodWriteAsDoubleBE
Writes a 64bit double floating point number at the current position in the packet packet. 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 OffsetDataWriter.)
Public Extension MethodWriteAsDoubleLE
Writes a 64bit double floating point number at the current position in the packet packet. 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 OffsetDataWriter.)
Public Extension MethodWriteAsInt16
Writes a 16bit signed integer at the current position in the packet packet. 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 OffsetDataWriter.)
Public Extension MethodWriteAsInt16BE
Writes a 16bit signed integer at the current position in the packet packet. 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 OffsetDataWriter.)
Public Extension MethodWriteAsInt16LE
Writes a 16bit signed integer at the current position in the packet packet. 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 OffsetDataWriter.)
Public Extension MethodWriteAsInt32
Writes a 32bit signed integer at the current position in the packet packet. 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 OffsetDataWriter.)
Public Extension MethodWriteAsInt32BE
Writes a 32bit signed integer at the current position in the packet packet. 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 OffsetDataWriter.)
Public Extension MethodWriteAsInt32LE
Writes a 32bit signed integer at the current position in the packet packet. 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 OffsetDataWriter.)
Public Extension MethodWriteAsInt64
Writes a 64bit signed integer at the current position in the packet packet. 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 OffsetDataWriter.)
Public Extension MethodWriteAsInt64BE
Writes a 64bit signed integer at the current position in the packet packet. 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 OffsetDataWriter.)
Public Extension MethodWriteAsInt64LE
Writes a 64bit signed integer at the current position in the packet packet. 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 OffsetDataWriter.)
Public Extension MethodWriteAsSByte
Writes a signed byte at the current position in the packet packet. 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 OffsetDataWriter.)
Public Extension MethodWriteAsSingle
Writes a 32bit single floating point number at the current position in the packet packet. 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 OffsetDataWriter.)
Public Extension MethodWriteAsSingleBE
Writes a 32bit single floating point number at the current position in the packet packet. 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 OffsetDataWriter.)
Public Extension MethodWriteAsSingleLE
Writes a 32bit single floating point number at the current position in the packet packet. 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 OffsetDataWriter.)
Public Extension MethodWriteAsString
Writes a string at the current position in the packet packet. The current position is advanced by the number of bytes written.
(Defined by OffsetDataWriter.)
Public Extension MethodWriteAsUInt16
Writes a 16bit unsigned integer at the current position in the packet packet. 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 OffsetDataWriter.)
Public Extension MethodWriteAsUInt16BE
Writes a 16bit unsigned integer at the current position in the packet packet. 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 OffsetDataWriter.)
Public Extension MethodWriteAsUInt16LE
Writes a 16bit unsigned integer at the current position in the packet packet. 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 OffsetDataWriter.)
Public Extension MethodWriteAsUInt32
Writes a 32bit unsigned integer at the current position in the packet packet. 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 OffsetDataWriter.)
Public Extension MethodWriteAsUInt32BE
Writes a 32bit unsigned integer at the current position in the packet packet. 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 OffsetDataWriter.)
Public Extension MethodWriteAsUInt32LE
Writes a 32bit unsigned integer at the current position in the packet packet. 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 OffsetDataWriter.)
Public Extension MethodWriteAsUInt64
Writes a 64bit unsigned integer at the current position in the packet packet. 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 OffsetDataWriter.)
Public Extension MethodWriteAsUInt64BE
Writes a 64bit unsigned integer at the current position in the packet packet. 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 OffsetDataWriter.)
Public Extension MethodWriteAsUInt64LE
Writes a 64bit unsigned integer at the current position in the packet packet. 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 OffsetDataWriter.)
Top
See Also