@FunctionalInterface public interface Serializer<T>
| 限定符和类型 | 方法和说明 |
|---|---|
void |
serialize(T object,
OutputStream outputStream)
Write an object of type T to the given OutputStream.
|
void serialize(T object, OutputStream outputStream) throws IOException
Note: Implementations should not close the given OutputStream (or any decorators of that OutputStream) but rather leave this up to the caller.
object - the object to serializeoutputStream - the output streamIOException - in case of errors writing to the stream