T
- type of the arrayprivate abstract static class PayloadSerializer.Primitive<T> extends PayloadSerializer.Helper<T>
Modifier and Type | Field and Description |
---|---|
private java.util.function.IntFunction<T> |
alloc
Array allocator
|
cls, typeCode
Constructor and Description |
---|
Primitive(java.lang.Class<T> cls,
java.util.function.IntFunction<T> alloc)
Constructor
|
Modifier and Type | Method and Description |
---|---|
java.util.function.IntFunction<T> |
getAlloc()
Get the allocator
|
protected abstract T |
read(java.io.ObjectInput in,
T a)
Read object (array) from the input stream
|
T |
readArray(java.io.ObjectInput in,
int len)
Read object (array) from the input stream
|
protected abstract void |
write(java.io.ObjectOutput out,
T a)
Write object (array) to the output stream
|
void |
writeArray(java.io.ObjectOutput out,
java.lang.Object o)
Write object (array) to the output stream
|
getCls, getTypeCode
private final java.util.function.IntFunction<T> alloc
public void writeArray(java.io.ObjectOutput out, java.lang.Object o) throws java.io.IOException
out
- output streamo
- array to be writtenjava.io.IOException
- In case of I/O errorpublic T readArray(java.io.ObjectInput in, int len) throws java.io.IOException
in
- input streamlen
- array lengthjava.io.IOException
- In case of I/O errorprotected abstract void write(java.io.ObjectOutput out, T a) throws java.io.IOException
out
- output streama
- array to be writtenjava.io.IOException
- In case of I/O errorprotected abstract T read(java.io.ObjectInput in, T a) throws java.io.IOException
in
- input streama
- target arrayjava.io.IOException
- In case of I/O errorpublic java.util.function.IntFunction<T> getAlloc()