Buffer
A byte buffer object
This page is a WIP. It contains all the information in Figura's documentation but we're working on adding more helpful descriptions.
getLength()
Returns length of this buffer
getLength()
Returns:
Type | Description |
---|---|
Integer | - |
Example:
-- example coming soon
getMaxCapacity()
Returns max capacity this buffer can have
getMaxCapacity()
Returns:
Type | Description |
---|---|
Integer | - |
Example:
-- example coming soon
setPosition()
Sets current position of this buffer
setPosition(position)
Parameters:
Name | Type | Description | Default |
---|---|---|---|
position | Integer | - | - |
Returns:
Type | Description |
---|---|
nil | - |
Example:
-- example coming soon
getPosition()
Returns current position of this buffer
getPosition()
Returns:
Type | Description |
---|---|
Integer | - |
Example:
-- example coming soon
available()
Returns amount of bytes available to read
available()
Returns:
Type | Description |
---|---|
Integer | - |
Example:
-- example coming soon
clear()
figura.docs.clear
clear()
Returns:
Type | Description |
---|---|
nil | - |
Example:
-- example coming soon
close()
Closes this buffer, marking it's memory to be freed by garbage collector. After calling this function buffer cant be used anymore
close()
Returns:
Type | Description |
---|---|
nil | - |
Example:
-- example coming soon
isClosed()
Checks, is this buffer closed or not
isClosed()
Returns:
Type | Description |
---|---|
Boolean | - |
Example:
-- example coming soon
read()
Reads one byte from this buffer
read()
Returns:
Type | Description |
---|---|
Integer | - |
Example:
-- example coming soon
readBase64()
Reads bytes from this buffer to a Base64 string. Length is amount of bytes to read, default length is 1024
- Overload 1
- Overload 2
Example:
-- example coming soon
readByteArray()
Reads bytes from this buffer to a string byte array. Length is amount of bytes to read, default length is 1024
- Overload 1
- Overload 2
Example:
-- example coming soon
readDouble()
Reads double from this buffer
readDouble()
Returns:
Type | Description |
---|---|
Number | - |
Example:
-- example coming soon
readDoubleLE()
Reads little endian double from this buffer
readDoubleLE()
Returns:
Type | Description |
---|---|
Number | - |
Example:
-- example coming soon
readFloat()
Reads float from this buffer
readFloat()
Returns:
Type | Description |
---|---|
Number | - |
Example:
-- example coming soon