/// <summary> /// Decode Base16 text through streams for generic use. Stream based variant tries to consume /// as little memory as possible, and relies of .NET's own underlying buffering mechanisms, /// contrary to their buffer-based versions. /// </summary> /// <param name="input">Stream that the encoded bytes would be read from.</param> /// <param name="output">Stream where decoded bytes will be written to.</param> public void Decode(TextReader input, Stream output) { StreamHelper.Decode(input, output, buffer => this.Decode(buffer.Span).ToArray()); }
/// <summary> /// Decode a text reader into a stream. /// </summary> /// <param name="input">Input reader.</param> /// <param name="output">Output stream.</param> public void Decode(TextReader input, Stream output) { StreamHelper.Decode(input, output, (text) => Decode(text.Span).ToArray(), decodeBufferSize); }