Skip to content

Commit 3b9c608

Browse files
authored
Add warning about serialize and deepcopy not being supported (#90)
1 parent 3f91138 commit 3b9c608

File tree

2 files changed

+36
-0
lines changed

2 files changed

+36
-0
lines changed

src/compression.jl

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@ Arguments
2626
---------
2727
- `level`: compression level (-1..9)
2828
- `windowbits`: size of history buffer (9..15)
29+
30+
!!! warning
31+
`serialize` and `deepcopy` will not work with this codec due to stored raw pointers.
2932
"""
3033
function GzipCompressor(;level::Integer=Z_DEFAULT_COMPRESSION,
3134
windowbits::Integer=Z_DEFAULT_WINDOWBITS)
@@ -43,6 +46,9 @@ const GzipCompressorStream{S} = TranscodingStream{GzipCompressor,S} where S<:IO
4346
GzipCompressorStream(stream::IO; kwargs...)
4447
4548
Create a gzip compression stream (see `GzipCompressor` for `kwargs`).
49+
50+
!!! warning
51+
`serialize` and `deepcopy` will not work with this stream due to stored raw pointers.
4652
"""
4753
function GzipCompressorStream(stream::IO; kwargs...)
4854
x, y = splitkwargs(kwargs, (:level, :windowbits))
@@ -68,6 +74,9 @@ Arguments
6874
---------
6975
- `level`: compression level (-1..9)
7076
- `windowbits`: size of history buffer (9..15)
77+
78+
!!! warning
79+
`serialize` and `deepcopy` will not work with this codec due to stored raw pointers.
7180
"""
7281
function ZlibCompressor(;level::Integer=Z_DEFAULT_COMPRESSION,
7382
windowbits::Integer=Z_DEFAULT_WINDOWBITS)
@@ -85,6 +94,9 @@ const ZlibCompressorStream{S} = TranscodingStream{ZlibCompressor,S} where S<:IO
8594
ZlibCompressorStream(stream::IO)
8695
8796
Create a zlib compression stream (see `ZlibCompressor` for `kwargs`).
97+
98+
!!! warning
99+
`serialize` and `deepcopy` will not work with this stream due to stored raw pointers.
88100
"""
89101
function ZlibCompressorStream(stream::IO; kwargs...)
90102
x, y = splitkwargs(kwargs, (:level, :windowbits))
@@ -110,6 +122,9 @@ Arguments
110122
---------
111123
- `level`: compression level (-1..9)
112124
- `windowbits`: size of history buffer (9..15)
125+
126+
!!! warning
127+
`serialize` and `deepcopy` will not work with this codec due to stored raw pointers.
113128
"""
114129
function DeflateCompressor(;level::Integer=Z_DEFAULT_COMPRESSION,
115130
windowbits::Integer=Z_DEFAULT_WINDOWBITS)
@@ -127,6 +142,9 @@ const DeflateCompressorStream{S} = TranscodingStream{DeflateCompressor,S} where
127142
DeflateCompressorStream(stream::IO; kwargs...)
128143
129144
Create a deflate compression stream (see `DeflateCompressor` for `kwargs`).
145+
146+
!!! warning
147+
`serialize` and `deepcopy` will not work with this stream due to stored raw pointers.
130148
"""
131149
function DeflateCompressorStream(stream::IO; kwargs...)
132150
x, y = splitkwargs(kwargs, (:level, :windowbits))

src/decompression.jl

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@ Arguments
2727
---------
2828
- `windowbits`: size of history buffer (8..15)
2929
- `gziponly`: flag to inactivate data format detection
30+
31+
!!! warning
32+
`serialize` and `deepcopy` will not work with this codec due to stored raw pointers.
3033
"""
3134
function GzipDecompressor(;windowbits::Integer=Z_DEFAULT_WINDOWBITS, gziponly::Bool=false)
3235
if !(8 windowbits 15)
@@ -41,6 +44,9 @@ const GzipDecompressorStream{S} = TranscodingStream{GzipDecompressor,S} where S<
4144
GzipDecompressorStream(stream::IO; kwargs...)
4245
4346
Create a gzip decompression stream (see `GzipDecompressor` for `kwargs`).
47+
48+
!!! warning
49+
`serialize` and `deepcopy` will not work with this stream due to stored raw pointers.
4450
"""
4551
function GzipDecompressorStream(stream::IO; kwargs...)
4652
x, y = splitkwargs(kwargs, (:windowbits, :gziponly))
@@ -64,6 +70,9 @@ Create a zlib decompression codec.
6470
Arguments
6571
---------
6672
- `windowbits`: size of history buffer (8..15)
73+
74+
!!! warning
75+
`serialize` and `deepcopy` will not work with this codec due to stored raw pointers.
6776
"""
6877
function ZlibDecompressor(;windowbits::Integer=Z_DEFAULT_WINDOWBITS)
6978
if !(8 windowbits 15)
@@ -78,6 +87,9 @@ const ZlibDecompressorStream{S} = TranscodingStream{ZlibDecompressor,S} where S<
7887
ZlibDecompressorStream(stream::IO; kwargs...)
7988
8089
Create a deflate decompression stream (see `ZlibDecompressor` for `kwargs`).
90+
91+
!!! warning
92+
`serialize` and `deepcopy` will not work with this stream due to stored raw pointers.
8193
"""
8294
function ZlibDecompressorStream(stream::IO; kwargs...)
8395
x, y = splitkwargs(kwargs, (:windowbits,))
@@ -101,6 +113,9 @@ Create a deflate decompression codec.
101113
Arguments
102114
---------
103115
- `windowbits`: size of history buffer (8..15)
116+
117+
!!! warning
118+
`serialize` and `deepcopy` will not work with this codec due to stored raw pointers.
104119
"""
105120
function DeflateDecompressor(;windowbits::Integer=Z_DEFAULT_WINDOWBITS)
106121
if !(8 windowbits 15)
@@ -115,6 +130,9 @@ const DeflateDecompressorStream{S} = TranscodingStream{DeflateDecompressor,S} wh
115130
DeflateDecompressorStream(stream::IO; kwargs...)
116131
117132
Create a deflate decompression stream (see `DeflateDecompressor` for `kwargs`).
133+
134+
!!! warning
135+
`serialize` and `deepcopy` will not work with this stream due to stored raw pointers.
118136
"""
119137
function DeflateDecompressorStream(stream::IO; kwargs...)
120138
x, y = splitkwargs(kwargs, (:windowbits,))

0 commit comments

Comments
 (0)