Exemplo n.º 1
0
 /// <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());
 }
Exemplo n.º 2
0
 /// <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);
 }