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 CborEncoder
encoder
-
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 void
encode(T dataItem)
protected void
encodeTypeAndLength(MajorType majorType, long length)
protected void
encodeTypeAndLength(MajorType majorType, BigInteger length)
protected void
encodeTypeChunked(MajorType majorType)
protected void
write(byte... bytes)
protected void
write(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
-
-