Top Description Fields Constructors Methods
org.apache.commons.compress.parallel

public Class FileBasedScatterGatherBackingStore

extends Object
implements ScatterGatherBackingStore
Class Inheritance
All Implemented Interfaces
org.apache.commons.compress.parallel.ScatterGatherBackingStore, java.io.Closeable, java.lang.AutoCloseable
Imports
java.io.File, .FileNotFoundException, .IOException, .InputStream, .OutputStream, .UncheckedIOException, java.nio.file.Files, .Path

ScatterGatherBackingStore that is backed by a path.
Since
1.10

Field Summary

Modifier and TypeField and Description
private boolean
private final OutputStream
private final Path

Constructor Summary

AccessConstructor and Description
public
public
FileBasedScatterGatherBackingStore(final Path
The path to offload compressed data into.
target
)

Constructs a new instance for the given path.

Method Summary

Modifier and TypeMethod and Description
public void
close()

Implements java.io.Closeable.close.

Closes this stream and releases any system resources associated with it.
public void
closeForWriting()

Implements org.apache.commons.compress.parallel.ScatterGatherBackingStore.closeForWriting.

Closes this backing store for further writing.
public InputStream
getInputStream()

Implements org.apache.commons.compress.parallel.ScatterGatherBackingStore.getInputStream.

An input stream that contains the scattered payload
public void
writeOut(final byte[]
the data to write
data
,
final int
offset inside data to start writing from
offset
,
final int
the amount of data to write
length
)

Implements org.apache.commons.compress.parallel.ScatterGatherBackingStore.writeOut.

Writes a piece of payload.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

closedback to summary
private boolean closed
outputStreamback to summary
private final OutputStream outputStream
targetback to summary
private final Path target

Constructor Detail

FileBasedScatterGatherBackingStoreback to summary
public FileBasedScatterGatherBackingStore(final File target) throws FileNotFoundException
FileBasedScatterGatherBackingStoreback to summary
public FileBasedScatterGatherBackingStore(final Path target) throws FileNotFoundException

Constructs a new instance for the given path.

Parameters
target:Path

The path to offload compressed data into.

Exceptions
FileNotFoundException:
if the file doesn't exist
Since
1.22

Method Detail

closeback to summary
public void close() throws IOException

Implements java.io.Closeable.close.

Doc from java.io.Closeable.close.

Closes this stream and releases any system resources associated with it. If the stream is already closed then invoking this method has no effect.

As noted in AutoCloseable#close(), cases where the close may fail require careful attention. It is strongly advised to relinquish the underlying resources and to internally mark the Closeable as closed, prior to throwing the IOException.

Annotations
@Override
Exceptions
IOException:
if an I/O error occurs
closeForWritingback to summary
public void closeForWriting() throws IOException

Implements org.apache.commons.compress.parallel.ScatterGatherBackingStore.closeForWriting.

Doc from org.apache.commons.compress.parallel.ScatterGatherBackingStore.closeForWriting.

Closes this backing store for further writing.

Annotations
@Override
Exceptions
IOException:
when something fails
getInputStreamback to summary
public InputStream getInputStream() throws IOException

Implements org.apache.commons.compress.parallel.ScatterGatherBackingStore.getInputStream.

Doc from org.apache.commons.compress.parallel.ScatterGatherBackingStore.getInputStream.

An input stream that contains the scattered payload

Returns:InputStream

An InputStream, should be closed by the caller of this method.

Annotations
@Override
Exceptions
IOException:
when something fails
writeOutback to summary
public void writeOut(final byte[] data, final int offset, final int length) throws IOException

Implements org.apache.commons.compress.parallel.ScatterGatherBackingStore.writeOut.

Doc from org.apache.commons.compress.parallel.ScatterGatherBackingStore.writeOut.

Writes a piece of payload.

Parameters
data:byte[]

the data to write

offset:int

offset inside data to start writing from

length:int

the amount of data to write

Annotations
@Override
Exceptions
IOException:
when something fails