CodecPipeline class

A pipeline for chaining multiple text codecs together.

This class allows you to combine multiple codecs into a single processing pipeline. Encoding applies codecs in order, while decoding applies them in reverse order.

Example:

final pipeline = CodecPipeline([
  GzipCodec(),
  Base64Codec(),
  HexCodec(),
]);

final encoded = pipeline.encode('Hello, World!');
final decoded = pipeline.decode(encoded);
Implemented types

Constructors

CodecPipeline.new(List<TextCodec> codecs)
Creates a new codec pipeline with the given codecs.

Properties

codecs List<TextCodec>
The list of codecs in this pipeline.
final
hashCode int
The hash code for this object.
no setterinherited
isEmpty bool
Returns whether the pipeline is empty.
no setter
isNotEmpty bool
Returns whether the pipeline is not empty.
no setter
length int
Returns the number of codecs in this pipeline.
no setter
name String
Returns the name/identifier of this codec.
no setteroverride
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

addCodec(TextCodec codec) CodecPipeline
Adds a codec to the end of the pipeline.
decode(String input) String
Decodes the input string using the codec's specific algorithm.
override
encode(String input) String
Encodes the input string using the codec's specific algorithm.
override
isValidInput(String input) bool
Optional method to validate if input can be processed by this codec.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
removeCodec(int index) CodecPipeline
Removes a codec from the pipeline at the specified index.
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited