1Clownfish::ByteBuf(3) User Contributed Perl DocumentationClownfish::ByteBuf(3)
2
3
4
6 Clownfish::ByteBuf - Growable buffer holding arbitrary bytes.
7
9 my $buf = Clownfish::ByteBuf->new($byte_string);
10 my $byte_string = $buf->to_perl;
11
14 new
15 my $buf = Clownfish::ByteBuf->new($byte_string);
16
17 Create a ByteBuf containing the passed-in bytes.
18
20 set_size
21 $byte_buf->set_size($size);
22
23 Resize the ByteBuf to "size". If greater than the objectXs capacity,
24 throws an error.
25
26 get_size
27 my $int = $byte_buf->get_size();
28
29 Return the size of the ByteBuf in bytes.
30
31 get_capacity
32 my $int = $byte_buf->get_capacity();
33
34 Return the number of bytes in the ByteBufXs allocation.
35
36 cat
37 $byte_buf->cat($blob);
38
39 Concatenate the contents of Blob "blob" onto the end of the original
40 ByteBuf. Allocate more memory as needed.
41
42 yield_blob
43 my $blob = $byte_buf->yield_blob();
44
45 Return the content of the ByteBuf as Blob and clear the ByteBuf.
46
47 utf8_to_string
48 my $string = $byte_buf->utf8_to_string();
49
50 Return a String which holds a copy of the UTF-8 character data in the
51 ByteBuf after checking for validity.
52
53 trusted_utf8_to_string
54 my $string = $byte_buf->trusted_utf8_to_string();
55
56 Return a String which holds a copy of the UTF-8 character data in the
57 ByteBuf, skipping validity checks.
58
59 compare_to
60 my $int = $byte_buf->compare_to($other);
61
62 Indicate whether one ByteBuf is less than, equal to, or greater than
63 another. The byte contents of the ByteBufs are compared
64 lexicographically. Throws an exception if "other" is not a ByteBuf.
65
66 Returns: 0 if the ByteBufs are equal, a negative number if "self" is
67 less than "other", and a positive number if "self" is greater than
68 "other".
69
70 clone
71 my $result = $byte_buf->clone();
72
73 Return a clone of the object.
74
76 Clownfish::ByteBuf isa Clownfish::Obj.
77
78
79
80perl v5.34.0 2021-07-22 Clownfish::ByteBuf(3)