Skip to content

Buffer

A buffer is a data structure that is used to store data in a sequential manner, only allowed to access that data once it has been completely written to the buffer.

It is used in th Discord Websocket to ensure that we receive an entire ZLib compressed message before we attempt to decompress it.

Properties

The Buffer instance has no set properties!

Methods

The Buffer instance has no set methods!

Functions

write

Buffer . write (

     self: Buffer
     data: string
)  -> ()

Responsible for writing data to the buffer.

flush

Buffer . flush (

     self: Buffer
)  -> ()

Responsible for flushing the data from the buffer and returning it.

new

Buffer . new ()  -> ()

Constructor for the Buffer object, will return a new instance of the Buffer object.