Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use CodecZlib.jl in place of Libz.jl #67

Merged
merged 1 commit into from
Mar 29, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion REQUIRE
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
julia 0.6
DataStructures
Libz
CodecZlib 0.4
FileIO 0.5.0
Compat 0.33
2 changes: 1 addition & 1 deletion src/JLD2.jl
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
__precompile__()

module JLD2
using DataStructures, Libz, FileIO
using DataStructures, CodecZlib, FileIO
import Base.sizeof
using Compat
if VERSION >= v"0.7.0-DEV.2009"
Expand Down
4 changes: 2 additions & 2 deletions src/dataio.jl
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ end
data_length::Int) where {T,RR}
io = f.io
inptr = io.curptr
data = read(ZlibInflateInputStream(unsafe_wrap(Array, Ptr{UInt8}(inptr), data_length); gzip=false))
data = transcode(ZlibDecompressor, unsafe_wrap(Array, Ptr{UInt8}(inptr), data_length))
@simd for i = 1:length(v)
dataptr = Ptr{Void}(pointer(data, odr_sizeof(RR)*(i-1)+1))
if !jlconvert_canbeuninitialized(rr) || jlconvert_isinitialized(rr, dataptr)
Expand Down Expand Up @@ -202,7 +202,7 @@ end
io = f.io
data_offset = position(io)
n = length(v)
data = read!(ZlibInflateInputStream(io; gzip=false), Vector{UInt8}(odr_sizeof(RR)*n))
data = read!(ZlibDecompressorStream(io), Vector{UInt8}(odr_sizeof(RR)*n))
@simd for i = 1:n
dataptr = Ptr{Void}(pointer(data, odr_sizeof(RR)*(i-1)+1))
if !jlconvert_canbeuninitialized(rr) || jlconvert_isinitialized(rr, dataptr)
Expand Down
2 changes: 1 addition & 1 deletion src/datasets.jl
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,7 @@ function deflate_data(f::JLDFile, data::Array{T}, odr::S, wsession::JLDWriteSess
@inbounds h5convert!(cp, odr, f, data[i], wsession)
cp += odr_sizeof(odr)
end
read(ZlibDeflateInputStream(buf; gzip=false))
transcode(ZlibCompressor, buf)
end

function write_dataset(f::JLDFile, dataspace::WriteDataspace, datatype::H5Datatype, odr::S, data::Array{T}, wsession::JLDWriteSession) where {T,S}
Expand Down