Skip to main content

BufferInscriber

Allows for a more manual approach to buffer serialization / deserialization. It requires some manual byte math, and buffer construction.

Functions

new

BufferInscriber.new(
instancebuffer?--

The buffer to initialize the class with.

) → BufferInscriber--

Returns an instance of the BufferInscriber class.

Create an instance of the BufferInscriber class.

info

The BufferInscriber class is much more low-level than the Buffer class. Using this class requires significantly more effort, as it does not handle everything that the Buffer class normally handles.

IncrementPointer

BufferInscriber:IncrementPointer(
amountnumber--

How much to increment the pointer by.

) → BufferInscriber

This function is used to increment the pointer.

SetPointer

BufferInscriber:SetPointer(
amountnumber--

What to set the pointer to.

) → BufferInscriber

This function is used to set the pointer.

Write

BufferInscriber:Write(
memorySizenumber,--

The amount of memory (bytes) being written.

dataTypestring,--

The data type being inscribed.

valuenumber--

The value being inscribed.

) → BufferInscriber

This function is utilized internally. It is used to write a specific data type into a buffer, and increment the pointer accordingly.

Read

BufferInscriber:Read(
memorySizenumber,--

The amount of memory being read.

dataTypestring--

The data type being read.

) → any

This function is utilized internally. It is used to read a specific data type from the buffer, and increment the pointer accordingly.

ReadType

BufferInscriber:ReadType(
dataTypestring,--

What DataType to read.

offsetnumber?--

A starting pointer. If none is supplied, it will use the current pointer.

) → any

This function is used to read a specific data type from the buffer.

WriteType

BufferInscriber:WriteType(
dataTypestring,--

What DataType to write.

dataany--

The data to write into the buffer.

) → BufferInscriber

This function is used to write a specific data type into the buffer.

SetBuffer

BufferInscriber:SetBuffer(
bufferbuffer--

The buffer being imported.

) → BufferInscriber

This function imports an external buffer, and begins using it.

Destroy

BufferInscriber:Destroy() → nil

This function cleans up the BufferInscriber instance.

Show raw api
{
    "functions": [
        {
            "name": "new",
            "desc": "Create an instance of the BufferInscriber class.\n\n\n:::info\nThe BufferInscriber class is much more low-level than the Buffer class.  Using this class requires significantly more effort, as it does not handle everything that the Buffer class normally handles.",
            "params": [
                {
                    "name": "instance",
                    "desc": "The buffer to initialize the class with.",
                    "lua_type": "buffer?"
                }
            ],
            "returns": [
                {
                    "desc": "Returns an instance of the BufferInscriber class.",
                    "lua_type": "BufferInscriber"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 282,
                "path": "src/Commons/Buffer/init.luau"
            }
        },
        {
            "name": "IncrementPointer",
            "desc": "This function is used to increment the pointer.",
            "params": [
                {
                    "name": "amount",
                    "desc": "How much to increment the pointer by.",
                    "lua_type": "number"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "BufferInscriber"
                }
            ],
            "function_type": "method",
            "source": {
                "line": 297,
                "path": "src/Commons/Buffer/init.luau"
            }
        },
        {
            "name": "SetPointer",
            "desc": "This function is used to set the pointer.",
            "params": [
                {
                    "name": "amount",
                    "desc": "What to set the pointer to.",
                    "lua_type": "number"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "BufferInscriber"
                }
            ],
            "function_type": "method",
            "source": {
                "line": 310,
                "path": "src/Commons/Buffer/init.luau"
            }
        },
        {
            "name": "Write",
            "desc": "This function is utilized internally.  It is used to write a specific data type into a buffer, and increment the pointer accordingly.",
            "params": [
                {
                    "name": "memorySize",
                    "desc": "The amount of memory (bytes) being written.",
                    "lua_type": "number"
                },
                {
                    "name": "dataType",
                    "desc": "The data type being inscribed.",
                    "lua_type": "string"
                },
                {
                    "name": "value",
                    "desc": "The value being inscribed.",
                    "lua_type": "number"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "BufferInscriber"
                }
            ],
            "function_type": "method",
            "source": {
                "line": 325,
                "path": "src/Commons/Buffer/init.luau"
            }
        },
        {
            "name": "Read",
            "desc": "This function is utilized internally.  It is used to read a specific data type from the buffer, and increment the pointer accordingly.",
            "params": [
                {
                    "name": "memorySize",
                    "desc": "The amount of memory being read.",
                    "lua_type": "number"
                },
                {
                    "name": "dataType",
                    "desc": "The data type being read.",
                    "lua_type": "string"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "any"
                }
            ],
            "function_type": "method",
            "source": {
                "line": 340,
                "path": "src/Commons/Buffer/init.luau"
            }
        },
        {
            "name": "ReadType",
            "desc": "This function is used to read a specific data type from the buffer.",
            "params": [
                {
                    "name": "dataType",
                    "desc": "What DataType to read.",
                    "lua_type": "string"
                },
                {
                    "name": "offset",
                    "desc": "A starting pointer.  If none is supplied, it will use the current pointer.",
                    "lua_type": "number?"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "any"
                }
            ],
            "function_type": "method",
            "source": {
                "line": 355,
                "path": "src/Commons/Buffer/init.luau"
            }
        },
        {
            "name": "WriteType",
            "desc": "This function is used to write a specific data type into the buffer.",
            "params": [
                {
                    "name": "dataType",
                    "desc": "What DataType to write.",
                    "lua_type": "string"
                },
                {
                    "name": "data",
                    "desc": "The data to write into the buffer.",
                    "lua_type": "any"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "BufferInscriber"
                }
            ],
            "function_type": "method",
            "source": {
                "line": 372,
                "path": "src/Commons/Buffer/init.luau"
            }
        },
        {
            "name": "SetBuffer",
            "desc": "This function imports an external buffer, and begins using it.",
            "params": [
                {
                    "name": "buffer",
                    "desc": "The buffer being imported.",
                    "lua_type": "buffer"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "BufferInscriber"
                }
            ],
            "function_type": "method",
            "source": {
                "line": 385,
                "path": "src/Commons/Buffer/init.luau"
            }
        },
        {
            "name": "Destroy",
            "desc": "This function cleans up the BufferInscriber instance.",
            "params": [],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "nil"
                }
            ],
            "function_type": "method",
            "source": {
                "line": 397,
                "path": "src/Commons/Buffer/init.luau"
            }
        }
    ],
    "properties": [],
    "types": [],
    "name": "BufferInscriber",
    "desc": "Allows for a more manual approach to buffer serialization / deserialization.  It requires some manual byte math, and buffer construction.",
    "source": {
        "line": 269,
        "path": "src/Commons/Buffer/init.luau"
    }
}