Interface ItemDecoder<T>
-
- All Superinterfaces:
AutoCloseable,Closeable
- All Known Implementing Classes:
AbstractInputStreamItemDecoder,AvroDecoder,CSVDecoder
public interface ItemDecoder<T> extends Closeable
A functional interface for stateful decoders, decoding object from some binary source. Each decoder should have a correspondingDecoderFactory, which is the type that pipes work with. Implementations typically receive a non-buffered input stream in their constructor, and do the necessary pre-processing (such as adding a buffered wrapper) there.- Author:
- Eyal Schneider
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default voidclose()Tdecode()Reads and decodes the next object from the input stream.
-
-
-
Method Detail
-
decode
T decode() throws IOException, ValidationPipeException
Reads and decodes the next object from the input stream.- Returns:
- The decoded item from the input stream provided on construction, or null if end of stream was reached
- Throws:
IOException- In case of a read errorValidationPipeException- In case that the data for decoding is illegal
-
close
default void close() throws IOException- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
IOException
-
-