Buffers are incredibly useful! They can be used to send data over the internet, to save and load from disk, or simply for general storage! Hopefully this article will help you understand how they work! Hit read more to expand!
Buffers are really simple!
Create one any size
or change the size later
You write data to it
which pushes the seek along
until the buffer is full.
You can also move the seek manually.
You'll need to, if you want to read the data again.
as reading & writing both push the seek.
Unless you use the special functions!
You can 'peek' at data in the buffer
and you can 'poke' new data in too
neither of which move the seek.
You probably won't use those much though!
Terminology
Really easy stuff! Exactly what you'd expect.
Really easy stuff! Exactly what you'd expect.
Types of buffer
Essentially, there are two. And they're pretty self explanatory!
Fixed buffers
The only way they'll change size, is if you resize them manually.
Growing buffers
When you write to them, they get larger as necessary.
When you write to them, they get larger as necessary.
Creating a buffer
Writing to a buffer
Moving the seek position
Reading from a buffer
coming soon! Click that approve button if you liked it so far!