method allocate
Documentation for method allocate
assembled from the following types:
role Blob
From Blob
(Blob) method allocate
Defined as:
multi method allocate(Blob: Int )multi method allocate(Blob: Int , int )multi method allocate(Blob: Int , Int \value)multi method allocate(Blob: Int , Mu )multi method allocate(Blob: Int , int )multi method allocate(Blob: Int , Blob )multi method allocate(Blob: Int , )
Returns a newly created Blob
object with the given number of elements. Optionally takes a second argument that indicates the pattern with which to fill the Blob
: this can be a single (possibly native) integer value, or any Iterable
that generates integer values, including another Blob
. The pattern will be repeated if not enough values are given to fill the entire Blob
.
my Blob = Blob.allocate(10,0);.say; # OUTPUT: «Blob:0x<00 00 00 00 00 00 00 00 00 00>»
If the pattern is a general Mu
value, it will fail.