Package org.apache.commons.codec.binary
Class AbstractBaseNCodecStreamBuilder<T,C extends BaseNCodec,B extends AbstractBaseNCodecStreamBuilder<T,C,B>>
- java.lang.Object
-
- org.apache.commons.codec.binary.AbstractBaseNCodecStreamBuilder<T,C,B>
-
- Type Parameters:
T- the stream type to build.C- ABaseNCodecsubclass.B- the builder subclass.
- All Implemented Interfaces:
java.util.function.Supplier<T>
- Direct Known Subclasses:
BaseNCodecInputStream.AbstracBuilder,BaseNCodecOutputStream.AbstractBuilder
public abstract class AbstractBaseNCodecStreamBuilder<T,C extends BaseNCodec,B extends AbstractBaseNCodecStreamBuilder<T,C,B>> extends java.lang.Object implements java.util.function.Supplier<T>
Builds input and output stream instances inBaseNCodecformat.- Since:
- 1.20.0
-
-
Constructor Summary
Constructors Constructor Description AbstractBaseNCodecStreamBuilder()Constructs a new instance.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected CgetBaseNCodec()Gets the codec to encode/decode a stream.protected booleangetEncode()Gets whether to encode or decode a stream.protected abstract CnewBaseNCodec()Creates a new BaseNCodec subclass of type C.BsetBaseNCodec(C baseNCodec)Sets a BaseNCodec subclass of type C.BsetEncode(boolean encode)Sets whether we should encode all data read (true), or if false if we should decode.
-
-
-
Constructor Detail
-
AbstractBaseNCodecStreamBuilder
public AbstractBaseNCodecStreamBuilder()
Constructs a new instance.
-
-
Method Detail
-
getBaseNCodec
protected C getBaseNCodec()
Gets the codec to encode/decode a stream.- Returns:
- the codec to encode/decode a stream.
-
getEncode
protected boolean getEncode()
Gets whether to encode or decode a stream.- Returns:
- whether to encode or decode a stream.
-
newBaseNCodec
protected abstract C newBaseNCodec()
Creates a new BaseNCodec subclass of type C.- Returns:
- a new BaseNCodec subclass of type C.
-
setBaseNCodec
public B setBaseNCodec(C baseNCodec)
Sets a BaseNCodec subclass of type C.- Parameters:
baseNCodec- a BaseNCodec subclass of type C.- Returns:
thisinstance.
-
-