Class AbstractOutputStreamItemEncoder<T>
- java.lang.Object
-
- org.pipecraft.pipes.serialization.AbstractOutputStreamItemEncoder<T>
-
- Type Parameters:
T- The data type of the items to encode
- All Implemented Interfaces:
Closeable,AutoCloseable,ItemEncoder<T>
public abstract class AbstractOutputStreamItemEncoder<T> extends Object implements ItemEncoder<T>
A base class for item encoders whose pre-processing on the output streams consists only on buffering and compression, providing the transformed output stream for the encode method to work on. Handles output stream closure.- Author:
- Eyal Schneider
-
-
Field Summary
Fields Modifier and Type Field Description protected BufferedOutputStreamos
-
Constructor Summary
Constructors Constructor Description AbstractOutputStreamItemEncoder(OutputStream os, FileWriteOptions writeOptions)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.ItemEncoder
encode
-
-
-
-
Field Detail
-
os
protected final BufferedOutputStream os
-
-
Constructor Detail
-
AbstractOutputStreamItemEncoder
public AbstractOutputStreamItemEncoder(OutputStream os, FileWriteOptions writeOptions) throws IOException
Constructor- Parameters:
os- The output stream to encode items intowriteOptions- The write options defining how to handle the output stream- Throws:
IOException- In case of IO error when preparing to write to the output stream
-
-
Method Detail
-
close
public void close() throws IOException- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
IOException
-
-