Class AbstractInputStreamItemDecoder<T>
- java.lang.Object
-
- org.pipecraft.pipes.serialization.AbstractInputStreamItemDecoder<T>
-
- Type Parameters:
T- The data type of decoded items
- All Implemented Interfaces:
Closeable,AutoCloseable,ItemDecoder<T>
public abstract class AbstractInputStreamItemDecoder<T> extends Object implements ItemDecoder<T>
A base class for item decoders whose pre-processing on the input streams consists only on buffering and decompression, providing the transformed input stream for the decode method to work on. Handles input stream closure.- Author:
- Eyal Schneider
-
-
Field Summary
Fields Modifier and Type Field Description protected BufferedInputStreamis
-
Constructor Summary
Constructors Constructor Description AbstractInputStreamItemDecoder(InputStream is, FileReadOptions readOptions)Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.pipecraft.pipes.serialization.ItemDecoder
decode
-
-
-
-
Field Detail
-
is
protected final BufferedInputStream is
-
-
Constructor Detail
-
AbstractInputStreamItemDecoder
public AbstractInputStreamItemDecoder(InputStream is, FileReadOptions readOptions) throws IOException
Constructor- Parameters:
is- The input stream to decode items fromreadOptions- The read options defining how to handle the input stream- Throws:
IOException- In case of IO error when preparing to read from the input stream
-
-
Method Detail
-
close
public void close() throws IOException- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein interfaceItemDecoder<T>- Throws:
IOException
-
-