T - generic type.@LimitedPrivate({"HDFS","MapReduce"})
@Evolving
public interface Serializer<T>
Provides a facility for serializing objects of type <T> to an
OutputStream.
Serializers are stateful, but must not buffer the output since
other producers may write to the output between calls to
serialize(Object).
| Modifier and Type | Method | Description |
|---|---|---|
void |
close() |
Close the underlying output stream and clear up any resources.
|
void |
open(java.io.OutputStream out) |
Prepare the serializer for writing.
|
void |
serialize(T t) |
Serialize
t to the underlying output stream. |
void open(java.io.OutputStream out) throws java.io.IOException
Prepare the serializer for writing.
out - output stream.java.io.IOException - raised on errors performing I/O.void serialize(T t) throws java.io.IOException
Serialize t to the underlying output stream.
t - t.java.io.IOException - raised on errors performing I/O.void close()
throws java.io.IOException
Close the underlying output stream and clear up any resources.
java.io.IOException - raised on errors performing I/O.Copyright © 2008–2025 Apache Software Foundation. All rights reserved.