Skip to content

Commit 10c639f

Browse files
authored
Document defaults of IO::Handle.read/readchars
1 parent 5e30f3c commit 10c639f

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

doc/Type/IO/Handle.pod6

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -500,9 +500,11 @@ $fh.close;
500500
501501
Defined as:
502502
503-
method read(IO::Handle:D: Int(Cool:D) $bytes --> Buf:D)
503+
method read(IO::Handle:D: Int(Cool:D) $bytes = 65536 --> Buf:D)
504504
505505
Binary reading; reads and returns up to C<$bytes> bytes from the filehandle.
506+
C<$bytes> defaults to an implementation-specific value (in Rakudo,
507+
the value of C<$*DEFAULT-READ-ELEMS>, which by default is set to C<65536>).
506508
This method can be called even when the handle is not
507509
L<in binary mode|/type/IO::Handle#method_encoding>.
508510
@@ -518,10 +520,12 @@ L<in binary mode|/type/IO::Handle#method_encoding>.
518520
519521
Defined as:
520522
521-
method readchars(IO::Handle:D: Int(Cool:D) $chars --> Str:D)
523+
method readchars(IO::Handle:D: Int(Cool:D) $chars = 65536 --> Str:D)
522524
523525
Reading chars; reads and returns up to C<$chars> chars (graphemes) from the
524-
filehandle. Attempting to call this method when the handle is
526+
filehandle. C<$chars> defaults to an implementation-specific value (in Rakudo,
527+
the value of C<$*DEFAULT-READ-ELEMS>, which by default is set to C<65536>).
528+
Attempting to call this method when the handle is
525529
L<in binary mode|/type/IO::Handle#method_encoding> will result in
526530
C<X::IO::BinaryMode> exception being thrown.
527531

0 commit comments

Comments
 (0)