diff --git a/src/utils.jl b/src/utils.jl index ca28ed59..d1efe22e 100644 --- a/src/utils.jl +++ b/src/utils.jl @@ -246,8 +246,13 @@ end consumeBOM(buf, pos) = (length(buf) >= 3 && buf[pos] == 0xef && buf[pos + 1] == 0xbb && buf[pos + 2] == 0xbf) ? pos + 3 : pos if isdefined(Base, :Memory) - __wrap(x) = view(x,Base.OneTo(length(x))) - __wrap(x::Array) = x + if isdefined(Base,:wrap) + __wrap(x) = Base.wrap(Array,x,length(x)) + __wrap(x::Array) = x + else + __wrap(x) = view(x,Base.OneTo(length(x))) + __wrap(x::Array) = x + end else __wrap(x) = x end @@ -268,7 +273,7 @@ end x = x.data return parent(x), first(x.indices), last(x.indices), tfile else #support from IOBuffer containing Memory - y = __wrap(x.data) #generates a Vector{UInt8} from Memory{UInt8} + y = __wrap(x.data) #generates a Vector{UInt8} from Memory{UInt8}, if available. return y, x.ptr, x.size, tfile end elseif x isa Cmd || x isa IO