T - the type of object to serializepublic abstract class AbstractSerializer<T> extends Object implements Serializer<T>
Serializers, with subclasses only needing to implement
* doSerialize(Object, OutputStream).| Modifier | Constructor and Description |
|---|---|
protected |
AbstractSerializer()
Default constructor, does not initialize any internal state.
|
| Modifier and Type | Method and Description |
|---|---|
protected abstract void |
doSerialize(T t,
OutputStream out)
Converts the specified Java object into a formatted data byte stream, writing the bytes to the specified
output stream. |
byte[] |
serialize(T t)
Converts the specified Java object into a formatted data byte array.
|
void |
serialize(T t,
OutputStream out)
Converts the specified Java object into a formatted data byte stream, writing the bytes to the specified
output stream. |
protected AbstractSerializer()
public final byte[] serialize(T t) throws SerializationException
serialize in interface Serializer<T>t - the object to serializeSerializationException - if there is a problem converting the object to a byte array.public final void serialize(T t, OutputStream out) throws SerializationException
output stream.serialize in interface Serializer<T>t - the object to convert to a byte streamout - the stream to write toSerializationException - if there is a problem converting the object to a byte stream or writing the
bytes to the output stream.protected abstract void doSerialize(T t, OutputStream out) throws Exception
output stream.t - the object to convert to a byte streamout - the stream to write toException - if there is a problem converting the object to a byte stream or writing the
bytes to the output stream.Copyright © 2014–2023 jsonwebtoken.io. All rights reserved.