@@ -753,21 +753,22 @@ take care of the underlying stream resource.
753753You SHOULD only use its public API and SHOULD NOT interfere with the underlying
754754stream resource manually.
755755
756- The ` $bufferSize ` property controls the maximum buffer size in bytes to read
757- at once from the stream.
756+ This class takes an optional ` int|null $readChunkSize ` parameter that controls
757+ the maximum buffer size in bytes to read at once from the stream.
758+ You can use a ` null ` value here in order to apply its default value.
758759This value SHOULD NOT be changed unless you know what you're doing.
759760This can be a positive number which means that up to X bytes will be read
760761at once from the underlying stream resource. Note that the actual number
761762of bytes read may be lower if the stream resource has less than X bytes
762763currently available.
763- This can be ` null ` which means "read everything available" from the
764+ This can be ` -1 ` which means "read everything available" from the
764765underlying stream resource.
765766This should read until the stream resource is not readable anymore
766767(i.e. underlying buffer drained), note that this does not neccessarily
767768mean it reached EOF.
768769
769770``` php
770- $stream->bufferSize = 8192;
771+ $stream = new ReadableResourceStream(STDIN, $loop, 8192) ;
771772```
772773
773774### WritableResourceStream
@@ -873,21 +874,23 @@ take care of the underlying stream resource.
873874You SHOULD only use its public API and SHOULD NOT interfere with the underlying
874875stream resource manually.
875876
876- The ` $bufferSize ` property controls the maximum buffer size in bytes to read
877- at once from the stream.
877+ This class takes an optional ` int|null $readChunkSize ` parameter that controls
878+ the maximum buffer size in bytes to read at once from the stream.
879+ You can use a ` null ` value here in order to apply its default value.
878880This value SHOULD NOT be changed unless you know what you're doing.
879881This can be a positive number which means that up to X bytes will be read
880882at once from the underlying stream resource. Note that the actual number
881883of bytes read may be lower if the stream resource has less than X bytes
882884currently available.
883- This can be ` null ` which means "read everything available" from the
885+ This can be ` -1 ` which means "read everything available" from the
884886underlying stream resource.
885887This should read until the stream resource is not readable anymore
886888(i.e. underlying buffer drained), note that this does not neccessarily
887889mean it reached EOF.
888890
889891``` php
890- $stream->bufferSize = 8192;
892+ $conn = stream_socket_client('tcp://google.com:80');
893+ $stream = new DuplexResourceStream($conn, $loop, 8192);
891894```
892895
893896Any ` write() ` calls to this class will not be performaned instantly, but will
0 commit comments