Skip to content

Commit

Permalink
Add docstring for read with default nb
Browse files Browse the repository at this point in the history
  • Loading branch information
kshyatt committed Aug 3, 2016
1 parent f1cf6d9 commit 1307ea2
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
6 changes: 5 additions & 1 deletion base/io.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 6 additions & 0 deletions doc/stdlib/io-network.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 1307ea2

Please sign in to comment.