Package ch.raffael.meldioc.library.codec
Class AbstractCharDataObjectCodec<T>
java.lang.Object
ch.raffael.meldioc.library.codec.AbstractCharDataObjectCodec<T>
- All Implemented Interfaces:
ObjectCodec<T>,ObjectDecoder<T>,ObjectEncoder<T>
Abstract object codec for character data like JSON or XML.
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final ContentTypestatic final intstatic final intstatic final io.vavr.control.Option<ContentType> -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedprotectedAbstractCharDataObjectCodec(int bufferSize) protectedAbstractCharDataObjectCodec(int bufferSize, io.vavr.control.Option<Charset> charset) protectedAbstractCharDataObjectCodec(io.vavr.control.Option<Charset> charset) -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract ContentTypedecode(byte[] data) decode(InputStream stream) protected abstract Tprotected Charsetio.vavr.Tuple2<byte[],ContentType> encode(T value, OutputStream target) protected abstract voidMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface ch.raffael.meldioc.library.codec.ObjectDecoder
isInvalidInput
-
Field Details
-
DEFAULT_BUFFER_SIZE
public static final int DEFAULT_BUFFER_SIZE- See Also:
-
MIN_BUFFER_SIZE
public static final int MIN_BUFFER_SIZE- See Also:
-
CONTENT_TYPE
-
SOME_CONTENT_TYPE
-
-
Constructor Details
-
AbstractCharDataObjectCodec
protected AbstractCharDataObjectCodec() -
AbstractCharDataObjectCodec
-
AbstractCharDataObjectCodec
protected AbstractCharDataObjectCodec(int bufferSize) -
AbstractCharDataObjectCodec
-
-
Method Details
-
decode
- Specified by:
decodein interfaceObjectDecoder<T>- Throws:
IOException
-
decode
- Specified by:
decodein interfaceObjectDecoder<T>- Throws:
IOException
-
encode
- Specified by:
encodein interfaceObjectEncoder<T>- Throws:
IOException
-
encode
- Specified by:
encodein interfaceObjectEncoder<T>- Throws:
IOException
-
decode
- Throws:
IOException
-
encode
- Throws:
IOException
-
defaultCharset
-
baseContentType
-