From 1307ea22c81f2689bf41cbdab7273f52d20a7b03 Mon Sep 17 00:00:00 2001 From: kshyatt Date: Wed, 3 Aug 2016 09:36:26 -0700 Subject: [PATCH] Add docstring for read with default nb --- base/io.jl | 6 +++++- doc/stdlib/io-network.rst | 6 ++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/base/io.jl b/base/io.jl index e186abdf9365b..29aa202314678 100644 --- a/base/io.jl +++ b/base/io.jl @@ -342,7 +342,11 @@ function readbytes!(s::IO, b::AbstractArray{UInt8}, nb=length(b)) return nr end -# read up to nb bytes from s, returning a Vector{UInt8} of bytes read. +""" + read(s::IO, nb=typemax(Int)) + +Read at most `nb` bytes from `s`, returning a `Vector{UInt8}` of the bytes read. +""" function read(s::IO, nb=typemax(Int)) # Let readbytes! grow the array progressively by default # instead of taking of risk of over-allocating diff --git a/doc/stdlib/io-network.rst b/doc/stdlib/io-network.rst index 97e8c7c0c286a..158560b2c9ba3 100644 --- a/doc/stdlib/io-network.rst +++ b/doc/stdlib/io-network.rst @@ -168,6 +168,12 @@ General I/O See ``read`` for a description of the ``all`` option. +.. function:: read(s::IO, nb=typemax(Int)) + + .. Docstring generated from Julia source + + Read at most ``nb`` bytes from ``s``\ , returning a ``Vector{UInt8}`` of the bytes read. + .. function:: read(s::IOStream, nb::Integer; all=true) .. Docstring generated from Julia source