From b78796864b0f55946feab511b0bb4e339a39ce2d Mon Sep 17 00:00:00 2001 From: Nathan Zimmerberg <39104088+nhz2@users.noreply.github.com> Date: Tue, 17 Dec 2024 22:07:33 -0500 Subject: [PATCH] Add warning about serialize and deepcopy not being supported (#44) --- src/compression.jl | 6 ++++++ src/decompression.jl | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/src/compression.jl b/src/compression.jl index b21391a..ad20aa2 100644 --- a/src/compression.jl +++ b/src/compression.jl @@ -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, @@ -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)) diff --git a/src/decompression.jl b/src/decompression.jl index 40ecf24..22b822c 100644 --- a/src/decompression.jl +++ b/src/decompression.jl @@ -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) @@ -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))