Package org.apache.hadoop.io.serializer
Interface Serializer<T>
- Type Parameters:
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).
-
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Close the underlying output stream and clear up any resources.voidopen(OutputStream out) Prepare the serializer for writing.voidSerializetto the underlying output stream.
-
Method Details
-
open
Prepare the serializer for writing.
- Parameters:
out- output stream.- Throws:
IOException- raised on errors performing I/O.
-
serialize
Serialize
tto the underlying output stream.- Parameters:
t- t.- Throws:
IOException- raised on errors performing I/O.
-
close
Close the underlying output stream and clear up any resources.
- Throws:
IOException- raised on errors performing I/O.
-