Skip to content

Commit 7b54ae7

Browse files
authored
relax type signature for PipeBuffer to accept AbstractVector{UInt8} (#52459)
Fixes #48585
1 parent 3accfe8 commit 7b54ae7

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

base/iobuffer.jl

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -123,19 +123,20 @@ function IOBuffer(;
123123
return buf
124124
end
125125

126-
# PipeBuffers behave like Unix Pipes. They are typically readable and writable, they act appendable, and are not seekable.
126+
# PipeBuffers behave somewhat more like Unix Pipes (than Files). They are typically readable and writable, they act appendable, and are not seekable.
127+
# However, they do not support stream notification, so for that there is the BufferStream wrapper around this.
127128

128129
"""
129-
PipeBuffer(data::Vector{UInt8}=UInt8[]; maxsize::Integer = typemax(Int))
130+
PipeBuffer(data::AbstractVector{UInt8}=UInt8[]; maxsize::Integer = typemax(Int))
130131
131132
An [`IOBuffer`](@ref) that allows reading and performs writes by appending.
132133
Seeking and truncating are not supported.
133134
See [`IOBuffer`](@ref) for the available constructors.
134135
If `data` is given, creates a `PipeBuffer` to operate on a data vector,
135136
optionally specifying a size beyond which the underlying `Array` may not be grown.
136137
"""
137-
PipeBuffer(data::Vector{UInt8}=UInt8[]; maxsize::Int = typemax(Int)) =
138-
GenericIOBuffer(data,true,true,false,true,maxsize)
138+
PipeBuffer(data::AbstractVector{UInt8}=UInt8[]; maxsize::Int = typemax(Int)) =
139+
GenericIOBuffer(data, true, true, false, true, maxsize)
139140
PipeBuffer(maxsize::Integer) = (x = PipeBuffer(StringVector(maxsize), maxsize = maxsize); x.size=0; x)
140141

141142
_similar_data(b::GenericIOBuffer, len::Int) = similar(b.data, len)

0 commit comments

Comments
 (0)