T
- the type of object returned after deserializationpublic abstract class AbstractDeserializer<T> extends Object implements Deserializer<T>
Deserializer
s, with subclasses only needing to implement
doDeserialize(Reader)
.Modifier and Type | Field and Description |
---|---|
protected static int |
EOF
EOF (End of File) marker, equal to
-1 . |
Modifier | Constructor and Description |
---|---|
protected |
AbstractDeserializer()
Default constructor, does not initialize any internal state.
|
Modifier and Type | Method and Description |
---|---|
T |
deserialize(byte[] bytes)
Convert the specified formatted data byte array into a Java object.
|
T |
deserialize(Reader reader)
Reads the specified character stream and returns the corresponding Java object.
|
protected abstract T |
doDeserialize(Reader reader)
Reads the specified character stream and returns the corresponding Java object.
|
protected static final int EOF
-1
.protected AbstractDeserializer()
public final T deserialize(byte[] bytes) throws DeserializationException
deserialize
in interface Deserializer<T>
bytes
- the formatted data byte array to convertDeserializationException
- if there is a problem converting the byte array to an object.public final T deserialize(Reader reader) throws DeserializationException
deserialize
in interface Deserializer<T>
reader
- the reader to use to read the character streamDeserializationException
- if there is a problem reading the stream or creating the expected Java objectprotected abstract T doDeserialize(Reader reader) throws Exception
reader
- the reader to use to read the character streamException
- if there is a problem reading the stream or creating the expected Java objectCopyright © 2014–2024 jsonwebtoken.io. All rights reserved.