Sets the string encoding of the SmartBuffer instance.
ReadonlyinternalGets the underlying internal Buffer. (This includes unmanaged data in the Buffer)
Sets the read offset value of the SmartBuffer instance.
Sets the write offset value of the SmartBuffer instance.
Clears the SmartBuffer instance to its original empty state.
Destroys the SmartBuffer instance.
Inserts a BigInt64BE value at the given offset value.
{ BigInt } The value to insert.
{ Number } The offset to insert the value at.
this
Inserts a Int64LE value at the given offset value.
{ BigInt } The value to insert.
{ Number } The offset to insert the value at.
this
Inserts a BigUInt64BE value at the given offset value.
{ Number } The value to insert.
{ Number } The offset to insert the value at.
this
Inserts a BigUInt64LE value at the given offset value.
{ Number } The value to insert.
{ Number } The offset to insert the value at.
this
Writes a Buffer to the current write position.
{ Buffer } The Buffer to write.
{ Number } The offset to write the Buffer to.
this
Inserts a null-terminated Buffer.
{ Buffer } The Buffer to write.
{ Number } The offset to write the Buffer to.
this
Inserts a DoubleBE value at the given offset value.
{ Number } The value to insert.
{ Number } The offset to insert the value at.
this
Inserts a DoubleLE value at the given offset value.
{ Number } The value to insert.
{ Number } The offset to insert the value at.
this
Inserts a FloatBE value at the given offset value.
{ Number } The value to insert.
{ Number } The offset to insert the value at.
this
Inserts a FloatLE value at the given offset value.
{ Number } The value to insert.
{ Number } The offset to insert the value at.
this
Inserts an Int16BE value at the given offset value.
{ Number } The value to insert.
{ Number } The offset to insert the value at.
this
Inserts an Int16LE value at the given offset value.
{ Number } The value to insert.
{ Number } The offset to insert the value at.
this
Inserts an Int32BE value at the given offset value.
{ Number } The value to insert.
{ Number } The offset to insert the value at.
this
Inserts an Int32LE value at the given offset value.
{ Number } The value to insert.
{ Number } The offset to insert the value at.
this
Inserts an Int8 value at the given offset value.
{ Number } The value to insert.
{ Number } The offset to insert the value at.
this
Inserts a String
{ String } The String value to insert.
{ Number } The offset to insert the string at.
Optionalencoding: BufferEncoding{ String } The BufferEncoding to use for writing strings (defaults to instance encoding).
this
Inserts a null-terminated String.
{ String } The String value to write.
Optionalencoding: BufferEncoding{ String } The BufferEncoding to use for writing strings (defaults to instance encoding).
this
Inserts an UInt16BE value at the given offset value.
{ Number } The value to insert.
{ Number } The offset to insert the value at.
this
Inserts an UInt16LE value at the given offset value.
{ Number } The value to insert.
{ Number } The offset to insert the value at.
this
Inserts an UInt32BE value at the given offset value.
{ Number } The value to insert.
{ Number } The offset to insert the value at.
this
Inserts an UInt32LE value at the given offset value.
{ Number } The value to insert.
{ Number } The offset to insert the value at.
this
Inserts an UInt8 value at the given offset value.
{ Number } The value to insert.
{ Number } The offset to insert the value at.
this
Reads a BigInt64BE value from the current read position or an optionally provided offset.
Optionaloffset: number{ Number } The offset to read data from (optional)
Reads a BigInt64LE value from the current read position or an optionally provided offset.
Optionaloffset: number{ Number } The offset to read data from (optional)
Reads a BigUInt64BE value from the current read position or an optionally provided offset.
Optionaloffset: number{ Number } The offset to read data from (optional)
Reads a BigUInt64LE value from the current read position or an optionally provided offset.
Optionaloffset: number{ Number } The offset to read data from (optional)
Reads a Buffer from the internal read position.
Optionallength: number{ Number } The length of data to read as a Buffer.
Reads a null-terminated Buffer from the current read poisiton.
Reads an DoublEBE value from the current read position or an optionally provided offset.
Optionaloffset: number{ Number } The offset to read data from (optional)
Reads an DoubleLE value from the current read position or an optionally provided offset.
Optionaloffset: number{ Number } The offset to read data from (optional)
Reads an FloatBE value from the current read position or an optionally provided offset.
Optionaloffset: number{ Number } The offset to read data from (optional)
Reads an FloatLE value from the current read position or an optionally provided offset.
Optionaloffset: number{ Number } The offset to read data from (optional)
Reads an Int16BE value from the current read position or an optionally provided offset.
Optionaloffset: number{ Number } The offset to read data from (optional)
Reads an Int16LE value from the current read position or an optionally provided offset.
Optionaloffset: number{ Number } The offset to read data from (optional)
Reads an Int32BE value from the current read position or an optionally provided offset.
Optionaloffset: number{ Number } The offset to read data from (optional)
Reads an Int32LE value from the current read position or an optionally provided offset.
Optionaloffset: number{ Number } The offset to read data from (optional)
Reads an Int8 value from the current read position or an optionally provided offset.
Optionaloffset: number{ Number } The offset to read data from (optional)
Reads a String from the current read position.
Optionalarg1: number | BufferEncoding{ Number | String } The number of bytes to read as a String, or the BufferEncoding to use for the string (Defaults to instance level encoding).
Optionalencoding: BufferEncoding{ String } The BufferEncoding to use for the string (Defaults to instance level encoding).
Reads a null-terminated String from the current read position.
Optionalencoding: BufferEncoding{ String } The BufferEncoding to use for the string (Defaults to instance level encoding).
Reads an UInt16BE value from the current read position or an optionally provided offset.
Optionaloffset: number{ Number } The offset to read data from (optional)
Reads an UInt16LE value from the current read position or an optionally provided offset.
Optionaloffset: number{ Number } The offset to read data from (optional)
Reads an UInt32BE value from the current read position or an optionally provided offset.
Optionaloffset: number{ Number } The offset to read data from (optional)
Reads an UInt32LE value from the current read position or an optionally provided offset.
Optionaloffset: number{ Number } The offset to read data from (optional)
Reads an UInt8 value from the current read position or an optionally provided offset.
Optionaloffset: number{ Number } The offset to read data from (optional)
Gets the remaining data left to be read from the SmartBuffer instance.
Gets the value of the internal managed Buffer (Includes managed data only)
Gets the String value of the internal managed Buffer
Optionalencoding: BufferEncoding{ String } The BufferEncoding to display the Buffer as (defaults to instance level encoding).
Writes a BigInt64BE value to the current write position (or at optional offset).
{ BigInt } The value to write.
Optionaloffset: number{ Number } The offset to write the value at.
this
Writes a BigInt64LE value to the current write position (or at optional offset).
{ BigInt } The value to write.
Optionaloffset: number{ Number } The offset to write the value at.
this
Writes a BigUInt64BE value to the current write position (or at optional offset).
{ Number } The value to write.
Optionaloffset: number{ Number } The offset to write the value at.
this
Writes a BigUInt64LE value to the current write position (or at optional offset).
{ Number } The value to write.
Optionaloffset: number{ Number } The offset to write the value at.
this
Writes a Buffer to the current write position.
{ Buffer } The Buffer to write.
Optionaloffset: number{ Number } The offset to write the Buffer to.
this
Writes a null-terminated Buffer.
{ Buffer } The Buffer to write.
Optionaloffset: number{ Number } The offset to write the Buffer to.
this
Writes a DoubleBE value to the current write position (or at optional offset).
{ Number } The value to write.
Optionaloffset: number{ Number } The offset to write the value at.
this
Writes a DoubleLE value to the current write position (or at optional offset).
{ Number } The value to write.
Optionaloffset: number{ Number } The offset to write the value at.
this
Writes a FloatBE value to the current write position (or at optional offset).
{ Number } The value to write.
Optionaloffset: number{ Number } The offset to write the value at.
this
Writes a FloatLE value to the current write position (or at optional offset).
{ Number } The value to write.
Optionaloffset: number{ Number } The offset to write the value at.
this
Writes an Int16BE value to the current write position (or at optional offset).
{ Number } The value to write.
Optionaloffset: number{ Number } The offset to write the value at.
this
Writes an Int16LE value to the current write position (or at optional offset).
{ Number } The value to write.
Optionaloffset: number{ Number } The offset to write the value at.
this
Writes an Int32BE value to the current write position (or at optional offset).
{ Number } The value to write.
Optionaloffset: number{ Number } The offset to write the value at.
this
Writes an Int32LE value to the current write position (or at optional offset).
{ Number } The value to write.
Optionaloffset: number{ Number } The offset to write the value at.
this
Writes an Int8 value to the current write position (or at optional offset).
{ Number } The value to write.
Optionaloffset: number{ Number } The offset to write the value at.
this
Writes a String
{ String } The String value to write.
Optionalarg2: number | BufferEncoding{ Number | String } The offset to write the string at, or the BufferEncoding to use.
Optionalencoding: BufferEncoding{ String } The BufferEncoding to use for writing strings (defaults to instance encoding).
this
Writes a null-terminated String.
{ String } The String value to write.
Optionalarg2: number | BufferEncoding{ Number | String } The offset to write the string to, or the BufferEncoding to use.
Optionalencoding: BufferEncoding{ String } The BufferEncoding to use for writing strings (defaults to instance encoding).
this
Writes an UInt16BE value to the current write position (or at optional offset).
{ Number } The value to write.
Optionaloffset: number{ Number } The offset to write the value at.
this
Writes an UInt16LE value to the current write position (or at optional offset).
{ Number } The value to write.
Optionaloffset: number{ Number } The offset to write the value at.
this
Writes an UInt32BE value to the current write position (or at optional offset).
{ Number } The value to write.
Optionaloffset: number{ Number } The offset to write the value at.
this
Writes an UInt32LE value to the current write position (or at optional offset).
{ Number } The value to write.
Optionaloffset: number{ Number } The offset to write the value at.
this
Writes an UInt8 value to the current write position (or at optional offset).
{ Number } The value to write.
Optionaloffset: number{ Number } The offset to write the value at.
this
StaticfromCreates a new SmartBuffer instance with the provided Buffer and optional encoding.
Optionalencoding: BufferEncoding{ String } The BufferEncoding to use for strings.
StaticfromCreates a new SmartBuffer instance with the provided SmartBufferOptions options.
{ SmartBufferOptions } The options to use when creating the SmartBuffer instance.
StaticfromCreates a new SmartBuffer instance with the provided internal Buffer size and optional encoding.
{ Number } The size of the internal Buffer.
Optionalencoding: BufferEncoding{ String } The BufferEncoding to use for strings.
StaticisType checking function that determines if an object is a SmartBufferOptions object.
I am a SmartBuffer wrapper for Celaria packet headers.