|
57 | 57 |
|
58 | 58 | Create a transcoding stream with `codec` and `stream`.
|
59 | 59 |
|
| 60 | +A `TranscodingStream` object wraps an input/output stream object `stream`, and |
| 61 | +transcodes the byte stream using `codec`. It is a subtype of `IO` and supports |
| 62 | +most of the I/O functions in the standard library. |
| 63 | +
|
| 64 | +See the docs (<https://bicycle1885.github.io/TranscodingStreams.jl/stable/>) for |
| 65 | +available codecs, examples, and more details of the type. |
| 66 | +
|
60 | 67 | Arguments
|
61 | 68 | ---------
|
62 | 69 |
|
63 |
| -- `codec`: The data transcoder. |
64 |
| -- `stream`: The wrapped stream. |
65 |
| -- `bufsize`: The initial buffer size. |
| 70 | +- `codec`: |
| 71 | + The data transcoder. The transcoding stream does the initialization and |
| 72 | + finalization of `codec`. Therefore, a codec object is not reusable once it |
| 73 | + is passed to a transcoding stream. |
| 74 | +- `stream`: |
| 75 | + The wrapped stream. It must be opened before passed to the constructor. |
| 76 | +- `bufsize`: |
| 77 | + The initial buffer size (the default size is 16KiB). The buffer may be |
| 78 | + extended whenever `codec` requests so. |
66 | 79 | - `stop_on_end`:
|
67 | 80 | The flag to stop transcoding on `:end` return code of `codec`. The
|
68 | 81 | transcoded data are readable even after the end of transcoding. Note that
|
69 |
| - some extra data may be buffered from `stream` and thus `sharedbuf` must be |
70 |
| - `true` to reuse `stream`. |
| 82 | + some extra data may be read from `stream` into a buffer and thus `sharedbuf` |
| 83 | + must be `true` to reuse `stream`. |
71 | 84 | - `sharedbuf`:
|
72 | 85 | The flag to share buffers between adjacent transcoding streams. The value
|
73 | 86 | must be `false` if `stream` is not a `TranscodingStream` object.
|
|
0 commit comments