Class FileBasedScatterGatherBackingStore
- java.lang.Object
-
- org.apache.commons.compress.parallel.FileBasedScatterGatherBackingStore
-
- All Implemented Interfaces:
java.io.Closeable
,java.lang.AutoCloseable
,ScatterGatherBackingStore
public class FileBasedScatterGatherBackingStore extends java.lang.Object implements ScatterGatherBackingStore
ScatterGatherBackingStore that is backed by a path.- Since:
- 1.10
-
-
Constructor Summary
Constructors Constructor Description FileBasedScatterGatherBackingStore(java.io.File target)
FileBasedScatterGatherBackingStore(java.nio.file.Path target)
Constructs a new instance for the given path.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
void
closeForWriting()
Closes this backing store for further writing.java.io.InputStream
getInputStream()
An input stream that contains the scattered payloadvoid
writeOut(byte[] data, int offset, int length)
Writes a piece of payload.
-
-
-
Constructor Detail
-
FileBasedScatterGatherBackingStore
public FileBasedScatterGatherBackingStore(java.io.File target) throws java.io.FileNotFoundException
- Throws:
java.io.FileNotFoundException
-
FileBasedScatterGatherBackingStore
public FileBasedScatterGatherBackingStore(java.nio.file.Path target) throws java.io.FileNotFoundException
Constructs a new instance for the given path.- Parameters:
target
- The path to offload compressed data into.- Throws:
java.io.FileNotFoundException
- if the file doesn't exist- Since:
- 1.22
-
-
Method Detail
-
close
public void close() throws java.io.IOException
- Specified by:
close
in interfacejava.lang.AutoCloseable
- Specified by:
close
in interfacejava.io.Closeable
- Throws:
java.io.IOException
-
closeForWriting
public void closeForWriting() throws java.io.IOException
Description copied from interface:ScatterGatherBackingStore
Closes this backing store for further writing.- Specified by:
closeForWriting
in interfaceScatterGatherBackingStore
- Throws:
java.io.IOException
- when something fails
-
getInputStream
public java.io.InputStream getInputStream() throws java.io.IOException
Description copied from interface:ScatterGatherBackingStore
An input stream that contains the scattered payload- Specified by:
getInputStream
in interfaceScatterGatherBackingStore
- Returns:
- An InputStream, should be closed by the caller of this method.
- Throws:
java.io.IOException
- when something fails
-
writeOut
public void writeOut(byte[] data, int offset, int length) throws java.io.IOException
Description copied from interface:ScatterGatherBackingStore
Writes a piece of payload.- Specified by:
writeOut
in interfaceScatterGatherBackingStore
- Parameters:
data
- the data to writeoffset
- offset inside data to start writing fromlength
- the amount of data to write- Throws:
java.io.IOException
- when something fails
-
-