Skip to content

Commit

Permalink
Allow non 1-based arrays in readbytes! (#200)
Browse files Browse the repository at this point in the history
  • Loading branch information
nhz2 authored Jun 24, 2024
1 parent fa0bd1f commit 2a7af65
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/stream.jl
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,7 @@ function Base.readbytes!(stream::TranscodingStream, b::DenseArray{UInt8}, nb=len
resize!(b, min(max(length(b) * 2, 8), nb))
resized = true
end
filled += GC.@preserve b unsafe_read(stream, pointer(b, filled+1), min(length(b), nb)-filled)
filled += GC.@preserve b unsafe_read(stream, pointer(b, filled+firstindex(b)), min(length(b), nb)-filled)
end
if resized
resize!(b, filled)
Expand Down

0 comments on commit 2a7af65

Please sign in to comment.