
Mojo::Buffer - A Simple In-Memory Buffer

use Mojo::Buffer;
my $buffer = Mojo::Buffer->new;
$buffer->add_chunk('bar');
my $foo = $buffer->remove(3);
my $bar = $buffer->empty;

Mojo::Buffer is a simple in-memory buffer.

Mojo::Buffer implements the following attributes.
raw_size my $size = $buffer->raw_size;
$buffer = $buffer->raw_size(23);

Mojo::Buffer inherits all methods from Mojo::Base and implements the following new ones.
newmy $buffer = Mojo::Buffer->new;
add_chunk $buffer = $buffer->add_chunk('foo');
contains my $position = $buffer->contains('something');
emptymy $chunk = $buffer->empty;
get_linemy $line = $buffer->get_line;
remove my $chunk = $buffer->remove(4);
my $chunk = $buffer->remove(4, 'abcd');
sizemy $size = $buffer->size;
to_string my $string = $buffer->to_string;
my $string = "$buffer";