Package io.activej.serializer.stream
Class StreamCodecs.AbstractArrayStreamCodec<T>
java.lang.Object
io.activej.serializer.stream.StreamCodecs.AbstractArrayStreamCodec<T>
- All Implemented Interfaces:
StreamCodec<T>,StreamDecoder<T>,StreamEncoder<T>
- Enclosing class:
- StreamCodecs
protected abstract static class StreamCodecs.AbstractArrayStreamCodec<T>
extends Object
implements StreamCodec<T>
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final intprotected final int -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractArrayStreamCodec(int elementSize) protectedAbstractArrayStreamCodec(int minElementSize, int maxElementSize) -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract TcreateArray(int length) final Tdecode(StreamInput input) protected abstract voiddoRead(BinaryInput input, T array, int offset, int count) protected abstract voiddoReadRemaining(StreamInput input, T array, int offset, int limit) protected abstract voiddoWrite(BinaryOutput output, T array, int offset, int limit) final voidencode(StreamOutput output, T array) protected abstract intgetArrayLength(T array)
-
Field Details
-
minElementSize
protected final int minElementSize -
maxElementSize
protected final int maxElementSize
-
-
Constructor Details
-
AbstractArrayStreamCodec
protected AbstractArrayStreamCodec(int minElementSize, int maxElementSize) -
AbstractArrayStreamCodec
protected AbstractArrayStreamCodec(int elementSize)
-
-
Method Details
-
encode
- Specified by:
encodein interfaceStreamEncoder<T>- Throws:
IOException
-
getArrayLength
-
doWrite
-
decode
- Specified by:
decodein interfaceStreamDecoder<T>- Throws:
IOException
-
createArray
-
doRead
-
doReadRemaining
protected abstract void doReadRemaining(StreamInput input, T array, int offset, int limit) throws IOException - Throws:
IOException
-