T - generic type.@LimitedPrivate({"HDFS","MapReduce"})
@Evolving
public interface Deserializer<T>
Provides a facility for deserializing objects of type <T> from an
InputStream.
Deserializers are stateful, but must not buffer the input since
other producers may read from the input between calls to
deserialize(Object).
| Modifier and Type | Method | Description |
|---|---|---|
void |
close() |
Close the underlying input stream and clear up any resources.
|
T |
deserialize(T t) |
Deserialize the next object from the underlying input stream.
|
void |
open(java.io.InputStream in) |
Prepare the deserializer for reading.
|
void open(java.io.InputStream in) throws java.io.IOException
Prepare the deserializer for reading.
in - input stream.java.io.IOException - raised on errors performing I/O.T deserialize(T t) throws java.io.IOException
Deserialize the next object from the underlying input stream.
If the object t is non-null then this deserializer
may set its internal state to the next object read from the input
stream. Otherwise, if the object t is null a new
deserialized object will be created.
t - t.java.io.IOException - raised on errors performing I/O.void close()
throws java.io.IOException
Close the underlying input stream and clear up any resources.
java.io.IOException - raised on errors performing I/O.Copyright © 2008–2025 Apache Software Foundation. All rights reserved.