3 # pack(template, buffer: nil) -> string
5 # Formats each element in +self+ into a binary string; returns that string.
6 # See {Packed Data}[rdoc-ref:packed_data.rdoc].
7 def pack(fmt, buffer: nil)
8 Primitive.pack_pack(fmt, buffer)
14 # unpack(template, offset: 0) -> array
16 # Extracts data from +self+, forming objects that become the elements of a new array;
18 # See {Packed Data}[rdoc-ref:packed_data.rdoc].
19 def unpack(fmt, offset: 0)
20 Primitive.attr! :use_block
21 Primitive.pack_unpack(fmt, offset)
25 # unpack1(template, offset: 0) -> object
27 # Like String#unpack, but unpacks and returns only the first extracted object.
28 # See {Packed Data}[rdoc-ref:packed_data.rdoc].
29 def unpack1(fmt, offset: 0)
30 Primitive.pack_unpack1(fmt, offset)