@@ -106,10 +106,10 @@ end
106106"""
107107 transcode!(output::Buffer, codec::Codec, input::Buffer)
108108
109- Transcode `input` by applying `codec` and storing the results in `output`.
110- Note that this method does not initialize or finalize `codec`. This is
111- efficient when you transcode a number of pieces of data, but you need to call
112- [`TranscodingStreams.initialize`](@ref) and
109+ Transcode `input` by applying `codec` and storing the results in `output`
110+ with validation of input and output. Note that this method does not initialize
111+ or finalize `codec`. This is efficient when you transcode a number of
112+ pieces of data, but you need to call [`TranscodingStreams.initialize`](@ref) and
113113[`TranscodingStreams.finalize`](@ref) explicitly.
114114"""
115115function transcode! (
@@ -118,6 +118,23 @@ function transcode!(
118118 input:: Buffer ,
119119)
120120 @assert ! Base. mightalias (input. data, output. data) " input and outbut buffers must be independent"
121+ unsafe_transcode! (output, coded, input)
122+ end
123+
124+ """
125+ unsafe_transcode!(output::Buffer, codec::Codec, input::Buffer)
126+
127+ Transcode `input` by applying `codec` and storing the results in `output`
128+ without validating input or output. Note that this method does not initialize
129+ or finalize `codec`. This is efficient when you transcode a number of
130+ pieces of data, but you need to call [`TranscodingStreams.initialize`](@ref) and
131+ [`TranscodingStreams.finalize`](@ref) explicitly.
132+ """
133+ function unsafe_transcode! (
134+ output:: Buffer ,
135+ codec:: Codec ,
136+ input:: Buffer ,
137+ )
121138 error = Error ()
122139 code = startproc (codec, :write , error)
123140 if code === :error
0 commit comments