Package co.nstant.in.cbor.encoder
Class AbstractEncoder<T>
- java.lang.Object
-
- co.nstant.in.cbor.encoder.AbstractEncoder<T>
-
- Direct Known Subclasses:
ArrayEncoder,ByteStringEncoder,DoublePrecisionFloatEncoder,HalfPrecisionFloatEncoder,MapEncoder,NegativeIntegerEncoder,SinglePrecisionFloatEncoder,SpecialEncoder,TagEncoder,UnicodeStringEncoder,UnsignedIntegerEncoder
public abstract class AbstractEncoder<T> extends Object
-
-
Field Summary
Fields Modifier and Type Field Description protected CborEncoderencoder
-
Constructor Summary
Constructors Constructor Description AbstractEncoder(CborEncoder encoder, OutputStream outputStream)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract voidencode(T dataItem)protected voidencodeTypeAndLength(MajorType majorType, long length)protected voidencodeTypeAndLength(MajorType majorType, BigInteger length)protected voidencodeTypeChunked(MajorType majorType)protected voidwrite(byte... bytes)protected voidwrite(int b)
-
-
-
Field Detail
-
encoder
protected final CborEncoder encoder
-
-
Constructor Detail
-
AbstractEncoder
public AbstractEncoder(CborEncoder encoder, OutputStream outputStream)
-
-
Method Detail
-
encode
public abstract void encode(T dataItem) throws CborException
- Throws:
CborException
-
encodeTypeChunked
protected void encodeTypeChunked(MajorType majorType) throws CborException
- Throws:
CborException
-
encodeTypeAndLength
protected void encodeTypeAndLength(MajorType majorType, long length) throws CborException
- Throws:
CborException
-
encodeTypeAndLength
protected void encodeTypeAndLength(MajorType majorType, BigInteger length) throws CborException
- Throws:
CborException
-
write
protected void write(int b) throws CborException- Throws:
CborException
-
write
protected void write(byte... bytes) throws CborException- Throws:
CborException
-
-