@@ -94,19 +94,21 @@ Arguments
94
94
Examples
95
95
--------
96
96
97
- ```julia
97
+ ```jldoctest
98
98
julia> using TranscodingStreams
99
99
100
100
julia> using CodecZlib
101
101
102
- julia> file = open(Pkg.dir("TranscodingStreams ", "test", "abra.gzip "));
102
+ julia> file = open(joinpath(dirname(pathof(CodecZlib)), ".. ", "test", "abra.gz "));
103
103
104
104
julia> stream = TranscodingStream(GzipDecompressor(), file)
105
- TranscodingStreams. TranscodingStream{CodecZlib. GzipDecompressor,IOStream}(<mode=idle>)
105
+ TranscodingStream{GzipDecompressor,IOStream}(<mode=idle>)
106
106
107
- julia> readstring( stream)
107
+ julia> String(read( stream) )
108
108
"abracadabra"
109
109
110
+ julia> close(stream)
111
+
110
112
```
111
113
"""
112
114
function TranscodingStream (codec:: Codec , stream:: IO ;
@@ -251,31 +253,6 @@ Return the number of bytes read from or written to `stream`.
251
253
Note that the returned value will be different from that of the underlying
252
254
stream wrapped by `stream`. This is because `stream` buffers some data and the
253
255
codec may change the length of data.
254
-
255
- Examples
256
- --------
257
-
258
- ```
259
- julia> using CodecZlib, TranscodingStreams
260
-
261
- julia> file = open(joinpath(dirname(pathof(CodecZlib)), "..", "test", "abra.gz"));
262
-
263
- julia> stream = GzipDecompressorStream(file)
264
- TranscodingStream{GzipDecompressor,IOStream}(<mode=idle>)
265
-
266
- julia> position(stream)
267
- 0
268
-
269
- julia> read(stream, 4)
270
- 4-element Array{UInt8,1}:
271
- 0x61
272
- 0x62
273
- 0x72
274
- 0x61
275
-
276
- julia> position(stream)
277
- 4
278
- ```
279
256
"""
280
257
function Base. position (stream:: TranscodingStream )
281
258
mode = stream. state. mode
0 commit comments