Skip to content

Commit

Permalink
Add warning about serialize and deepcopy not being supported (#44)
Browse files Browse the repository at this point in the history
  • Loading branch information
nhz2 authored Dec 18, 2024
1 parent 2448703 commit b787968
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/compression.jl
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ Arguments
- `blocksize100k`: block size to be use for compression (1..9)
- `workfactor`: amount of effort the standard algorithm will expend before resorting to the fallback (0..250)
- `verbosity`: verbosity level (0..4)
!!! warning
`serialize` and `deepcopy` will not work with this codec due to stored raw pointers.
"""
function Bzip2Compressor(;blocksize100k::Integer=DEFAULT_BLOCKSIZE100K,
workfactor::Integer=DEFAULT_WORKFACTOR,
Expand All @@ -48,6 +51,9 @@ const Bzip2CompressorStream{S} = TranscodingStream{Bzip2Compressor,S} where S<:I
Bzip2CompressorStream(stream::IO; kwargs...)
Create a bzip2 compression stream (see `Bzip2Compressor` for `kwargs`).
!!! warning
`serialize` and `deepcopy` will not work with this stream due to stored raw pointers.
"""
function Bzip2CompressorStream(stream::IO; kwargs...)
x, y = splitkwargs(kwargs, (:blocksize100k, :workfactor, :verbosity))
Expand Down
6 changes: 6 additions & 0 deletions src/decompression.jl
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ Arguments
---------
- `small`: flag to activate an algorithm which uses less memory
- `verbosity`: verbosity level (0..4)
!!! warning
`serialize` and `deepcopy` will not work with this codec due to stored raw pointers.
"""
function Bzip2Decompressor(;small::Bool=false, verbosity::Integer=DEFAULT_VERBOSITY)
if !(0 verbosity 4)
Expand All @@ -36,6 +39,9 @@ const Bzip2DecompressorStream{S} = TranscodingStream{Bzip2Decompressor,S} where
Bzip2DecompressorStream(stream::IO; kwargs...)
Create a bzip2 decompression stream (see `Bzip2Decompressor` for `kwargs`).
!!! warning
`serialize` and `deepcopy` will not work with this stream due to stored raw pointers.
"""
function Bzip2DecompressorStream(stream::IO; kwargs...)
x, y = splitkwargs(kwargs, (:small, :verbosity))
Expand Down

0 comments on commit b787968

Please sign in to comment.