public enum JDKObjectSerializer extends Enum<JDKObjectSerializer> implements ObjectSerializer
Enum Constant and Description |
---|
INSTANCE |
Modifier and Type | Method and Description |
---|---|
<T> T |
readSerializable(Bytes bytes,
Class<T> expectedClass,
T object)
Read an object
|
static JDKObjectSerializer |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static JDKObjectSerializer[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
void |
writeSerializable(Bytes bytes,
Object object,
Class expectedClass)
write an object
|
public static final JDKObjectSerializer INSTANCE
public static JDKObjectSerializer[] values()
for (JDKObjectSerializer c : JDKObjectSerializer.values()) System.out.println(c);
public static JDKObjectSerializer valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is nullpublic void writeSerializable(Bytes bytes, Object object, Class expectedClass) throws IOException
ObjectSerializer
writeSerializable
in interface ObjectSerializer
bytes
- to write toobject
- object to writeexpectedClass
- which will be provided on read, can be nullIOException
public <T> T readSerializable(@NotNull Bytes bytes, Class<T> expectedClass, T object) throws IOException, ClassNotFoundException
ObjectSerializer
readSerializable
in interface ObjectSerializer
bytes
- to readexpectedClass
- proved when writing, can be nullobject
- to populate, can be nullIOException
- if it not possible to serialize the objectClassNotFoundException
- if the expectedClass can not be createdCopyright © 2019. All rights reserved.