Class AvroCodecFactory<T>
- java.lang.Object
-
- org.pipecraft.pipes.serialization.AvroCodecFactory<T>
-
- Type Parameters:
T- The data type we wish to encode/decode
- All Implemented Interfaces:
CodecFactory<T>,DecoderFactory<T>,EncoderFactory<T>
public class AvroCodecFactory<T> extends Object implements CodecFactory<T>
A codec factory for AVRO format. Bound to a data type provided at factory creation time.- Author:
- Eyal Schneider
-
-
Constructor Summary
Constructors Constructor Description AvroCodecFactory(Class<T> clazz)Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ItemDecoder<T>newDecoder(InputStream is, FileReadOptions readOptions)ItemEncoder<T>newEncoder(OutputStream os, FileWriteOptions writeOptions)-
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.CodecFactory
getByteArrayCodec
-
Methods inherited from interface org.pipecraft.pipes.serialization.DecoderFactory
newByteArrayDecoder, newDecoder
-
Methods inherited from interface org.pipecraft.pipes.serialization.EncoderFactory
newByteArrayEncoder, newEncoder
-
-
-
-
Method Detail
-
newEncoder
public ItemEncoder<T> newEncoder(OutputStream os, FileWriteOptions writeOptions) throws IOException
- Specified by:
newEncoderin interfaceEncoderFactory<T>- Parameters:
os- The output stream the encoder should be bound to. Not expected to be buffered. The encoder handles buffering.writeOptions- The way the output stream should be handled- Returns:
- The new encoder
- Throws:
IOException- In case of an IO error while preparing to write to the output stream
-
newDecoder
public ItemDecoder<T> newDecoder(InputStream is, FileReadOptions readOptions) throws IOException
- Specified by:
newDecoderin interfaceDecoderFactory<T>- Parameters:
is- The input stream the decoder should be bound to. Not expected to be buffered. Buffering is added by the decoder.readOptions- defines how the input stream should be handled- Returns:
- The new decoder
- Throws:
IOException- In case of an IO error while preparing to read from the input stream
-
-