Package org.pipecraft.pipes.sync.inter
Class IntermediateBinFileWriterPipe<T>
- java.lang.Object
-
- org.pipecraft.pipes.sync.inter.DelegatePipe<T>
-
- org.pipecraft.pipes.sync.inter.IntermediateBinFileWriterPipe<T>
-
- All Implemented Interfaces:
Closeable,AutoCloseable,BasePipe,Pipe<T>
public class IntermediateBinFileWriterPipe<T> extends DelegatePipe<T>
The intermediate version ofBinFileWriterPipe. Writes items to a local file in a binary format. Supports compression.- Author:
- Eyal Schneider
-
-
Constructor Summary
Constructors Constructor Description IntermediateBinFileWriterPipe(Pipe<T> input, File outputFile, FileWriteOptions options, EncoderFactory<? super T> encoderFactory)ConstructorIntermediateBinFileWriterPipe(Pipe<T> input, File outputFile, EncoderFactory<? super T> encoderFactory)Constructor Uses default file write settings (see @{FileWriteOptions})
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Tnext()voidstart()Performs pre-processing prior to item flow throw the pipe.-
Methods inherited from class org.pipecraft.pipes.sync.inter.DelegatePipe
getOriginPipe, getProgress, peek
-
-
-
-
Constructor Detail
-
IntermediateBinFileWriterPipe
public IntermediateBinFileWriterPipe(Pipe<T> input, File outputFile, FileWriteOptions options, EncoderFactory<? super T> encoderFactory)
Constructor- Parameters:
input- The input pipe to read items fromoutputFile- The output fileoptions- The file writing optionsencoderFactory- The encoder factory to use for converting items to binary form
-
IntermediateBinFileWriterPipe
public IntermediateBinFileWriterPipe(Pipe<T> input, File outputFile, EncoderFactory<? super T> encoderFactory)
Constructor Uses default file write settings (see @{FileWriteOptions})- Parameters:
input- The input pipe to read items fromoutputFile- The output fileencoderFactory- The encoder factory to use for converting items to binary form
-
-
Method Detail
-
close
public void close() throws IOException- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classDelegatePipe<T>- Throws:
IOException
-
start
public void start() throws PipeException, InterruptedExceptionDescription copied from interface:BasePipePerforms pre-processing prior to item flow throw the pipe. Implementations must call the same method for all their input pipes before accessing their items. This is typically done here.- Specified by:
startin interfaceBasePipe- Overrides:
startin classDelegatePipe<T>- Throws:
PipeException- In case of pipe errors in this pipe or somewhere up-stream.InterruptedException- In case that the operation has been interrupted by another thread.
-
next
public T next() throws PipeException, InterruptedException
- Specified by:
nextin interfacePipe<T>- Overrides:
nextin classDelegatePipe<T>- Returns:
- The next item in this pipe output, or null if the output end has been reached. May be a blocking operation.
- Throws:
PipeException- In case of pipe errors in this pipe or somewhere up-stream while trying to prepare next item to return.InterruptedException- In case that the operation has been interrupted by another thread.
-
-