StreamChannelTransformer<S, T>.fromCodec constructor

StreamChannelTransformer<S, T>.fromCodec(
  1. Codec<S, T> codec
)

Creates a StreamChannelTransformer from a codec's encoder and decoder.

All input to the inner channel's sink is encoded using Codec.encoder, and all output from its stream is decoded using Codec.decoder.

Implementation

StreamChannelTransformer.fromCodec(Codec<S, T> codec)
    : this(codec.decoder,
          StreamSinkTransformer.fromStreamTransformer(codec.encoder));