=begin pod

=head1 Buf

    class Buf does Positional { ... }

A C<Buf> (short for buffer) is a binary string, and generally returned from
low-level IO operations (C<$io.read($number-of-by)>) or from C<Str.encode>.
It can be used to for writing to IO handles as C<$io.write($buf)>.

In the abstract it is just a list of integers, so
for example indexing into a C<Buf> with C<.[$idx]> returns an C<Int>.

=head2 Methods

=head3 new

    method new(*@codes)

Creates a C<Buf> from a list of integers.

=head3  Bool

    multi method Bool(Buf:D:)

Returns C<False> if and only if the buffer is empty.

=head3 elems

    multi method elems(Buf:D:) returns Int:D

Returns the number of elements of the buffer.

=head3 decode

    multi method decode(Buf:D: Str:D $encoding = 'UTF-8') returns Str:D

Applies an encoding to turn the buffer into a C<Str>.

=end pod
