package bytebuffer
Module BytebufferSource
Extensible buffers using bigstrings.
create size returns a new empty bytebuffer. This function will allocate a new bigstring of size size. The bytebuffer will be resized automatically if attempting to add more than size characters to the bytebuffer.
of_bigstring creates a new bytebuffer and uses the user provided bigstring as the backing store.
contents returns a copy of the current contents of the bytebuffer.
contents_string is the same as contents except it returns the copy as a string.
reset clears the bytebuffer and resets the underlying bigstring to the initial bigstring used during create.
add_bigstring appends a bigstring at the end of the bytebuffer.
fill returns a view into the buffer's underlying bigstring that can be used to blit bytes directly into the buffer. This can be useful to directly read content into the buffer.
consume returns a view into the buffer's underlying bigstring that can be used to blit bytes from the buffer. This can be useful to consume bytes from the buffer and blit them directly for I/O operations.
index returns the index of the character if it exists within the buffer.
unsafe_index is similar to index but instead of options it returns a negative integer if the character isn't present in the buffer.