Buffer.fromFile() - Mtax-Development/GML-OOP GitHub Wiki

Arguments

Name
Type
Optional
path
{string:path}
No
offset?
{int}
Yes
async_size?
Yes

Returns

{int|undefined}

Description

Recreate a Buffer from the specified file containing a previously saved file and load it to this Buffer. A byte offset can be specified for where the operation will start and continue until either the specified amount of bytes was affected or the end of this Buffer was reached. If no offset was specified, this Buffer will be replaced with a Buffer of Grow type and alignment of 1 byte. An amount of bytes can be specified to read asynchronously, in which case this operation will be performed asynchronously and until that amount was loaded or the entire Buffer, if the specified as {all}. If done so, the file path will have "Default" added at the beginning of it automatically, and an ID will be returned for use in the SaveLoad asynchronous event. Otherwise, {undefined} will be returned.

⚠️ **GitHub.com Fallback** ⚠️