File tree Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change 9
9
The C < Blob > role is an immutable interface to binary types, and offers a
10
10
list-like interface to lists of integers, typically unsigned integers.
11
11
12
+ However, it's a parameterized type, and you can instantiate with several
13
+ integer types:
14
+
15
+ = for code
16
+ my $b = Blob[int32].new(3, -3, 0xff32, -44);
17
+ say $b; # OUTPUT: «Blob[int32]:0x<03 -3 FF32 -2C>»
18
+
19
+ By default, C < Blob > uses 8-bit unsigned integers, that is, it is
20
+ equivalent to Blob[uint8]. Some other types of C < Blob > s which are used
21
+ often get their own class name.
22
+
23
+ X < |blob8 > X < |blob16 > X < |blob32 > X < |blob64 >
24
+ = begin table
25
+ blob8 | Blob[uint8]
26
+ blob16 | Blob[uint16]
27
+ blob32 | Blob[uint32]
28
+ blob64 | Blob[uint64]
29
+ = end table
30
+
31
+ You can use these in pretty much the same way you would with C < Blob > :
32
+
33
+ my $blob = blob8.new(3, 6, 254);
34
+ say $blob; # OUTPUT: «Blob[uint8]:0x<03 06 FE>»
35
+
12
36
= head1 Methods
13
37
14
38
= head2 method new
You can’t perform that action at this time.
0 commit comments