Buffer – Giavapps File

 

Buffer

 

gf_buffer_load(FileName) Loads the buffer data that was previously saved using the gf_buffer_save() function into a new buffer. This new buffer is created by the function as a "grow" buffer with a byte alignment of 1, and the new BufferIndex is returned. This BufferIndex should be stored in a variable and used in all further function calls to this buffer.

FileName: a valid file name. This argument doesn’t support Unicode characters.

 

gf_buffer_save(BufferIndex, FileName) Saves the contents of a buffer to a file, ready to be read back into memory using the gf_buffer_load() function.

BufferIndex: a valid buffer index.
FileName: a valid file name. This argument doesn’t support Unicode characters.

 

Code Examples

 

Loading And Reading Buffers

 

var buffer = gf_buffer_load(working_directory+"buffer.buffer");

show_message(
"BUFFER[0]: "+string( buffer_read(buffer, buffer_u8) )
+"#BUFFER[1]: "+string( buffer_read(buffer, buffer_u8) )
+"#BUFFER[2]: "+string( buffer_read(buffer, buffer_u8) )
+"#BUFFER[3]: "+string( buffer_read(buffer, buffer_u8) )
);

buffer_delete(buffer);

 

Writing And Saving Buffers

 

var buffer = buffer_create(4, buffer_grow, 1);

buffer_write(buffer, buffer_u8, 0);
buffer_write(buffer, buffer_u8, 1);
buffer_write(buffer, buffer_u8, 2);
buffer_write(buffer, buffer_u8, 3);

gf_buffer_save(buffer, working_directory+"buffer.buffer");

buffer_delete(buffer);

 

I am Luigi Piscopo, also known as DJ GiDeejay / Producer / Remixer in the music world. I am a Producer with a lot of experience in photo editing, video editing, audio editing, graphic design, web design, programming and promotion.

 

Leave a Reply

Il tuo indirizzo email non sarà pubblicato. I campi obbligatori sono contrassegnati *

*