Skip to content

Commit 48072be

Browse files
committed
Document blob8.read-(u)bits / buf8.write-(u)bits
1 parent b948c9d commit 48072be

File tree

2 files changed

+46
-1
lines changed

2 files changed

+46
-1
lines changed

doc/Type/Blob.pod6

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -337,6 +337,28 @@ Defined as:
337337
Returns a native C<num> value for the B<eight> bytes starting at the given
338338
position.
339339
340+
=head1 Methods on blob8 only (6.d, 2019.01 and later)
341+
342+
=head2 method read-ubits
343+
344+
Defined as:
345+
346+
method read-ubits(blob8:D: uint $pos, uint $bits --> UInt:D)
347+
348+
Returns an unsigned integer value for the B<bits> from the given B<bit> offset
349+
and given number of bits. The endianness of the bits is assumed to be
350+
C<BigEndian>.
351+
352+
=head2 method read-bits
353+
354+
Defined as:
355+
356+
method read-bits(blob8:D: uint $pos, uint $bits --> Int:D)
357+
358+
Returns a signed integer value for the B<bits> from the given B<bit> offset
359+
and given number of bits. The endianness of the bits is assumed to be
360+
C<BigEndian>.
361+
340362
=end pod
341363

342-
# vim: expandtab softtabstop=4 shiftwidth=4 ft=perl6
364+
# vim: expandtab softtabstop=4 shiftwidth=4 ft=perl6

doc/Type/Buf.pod6

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -296,6 +296,29 @@ Defined as:
296296
Writes a native C<num64> IEEE floating point value at the given position with
297297
the given endianness.
298298
299+
300+
=head1 Methods on blob8 only (6.d, 2019.01 and later)
301+
302+
=head2 method write-ubits
303+
304+
Defined as:
305+
306+
method write-ubits(blob8:D: uint $pos, uint $bits, UInt:D $value --> Nil)
307+
308+
Writes an unsigned integer value to the B<bits> from the given B<bit> offset
309+
and given number of bits. The endianness of the bits is assumed to be
310+
C<BigEndian>. Always returns Nil.
311+
312+
=head2 method write-bits
313+
314+
Defined as:
315+
316+
method write-bits(blob8:D: uint $pos, uint $bits, Int:D $balue --> Nil)
317+
318+
Writes a signed integer value for the B<bits> from the given B<bit> offset
319+
and given number of bits. The endianness of the bits is assumed to be
320+
C<BigEndian>. Always returns Nil.
321+
299322
=end pod
300323

301324
# vim: expandtab softtabstop=4 shiftwidth=4 ft=perl6

0 commit comments

Comments
 (0)