Package de.aristaflow.adept2.util.io
Class FileContent
- java.lang.Object
-
- de.aristaflow.adept2.util.io.RereadableContent
-
- de.aristaflow.adept2.util.io.FileContent
-
- All Implemented Interfaces:
Closeable
,AutoCloseable
public class FileContent extends RereadableContent
ARereadableContent
based on a file.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static class
FileContent.FileCloseable
This class implements the cleanup without referring to theRereadableContent
it cleans up.-
Nested classes/interfaces inherited from class de.aristaflow.adept2.util.io.RereadableContent
RereadableContent.RrcCleanup, RereadableContent.RrcInputStream
-
-
Field Summary
Fields Modifier and Type Field Description protected Path
file
The file containing the content of aRereadableContent
.-
Fields inherited from class de.aristaflow.adept2.util.io.RereadableContent
cleanup, existingStreams, finalCleanup, RRC_INPUT_STREAM_SIZE, sha512hash, size
-
-
Constructor Summary
Constructors Constructor Description FileContent(SwitchingOutputStream sos)
Creates a newRereadableContent
based on the designated output stream.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected InputStream
createInputStream()
Creates a new input stream for the content.-
Methods inherited from class de.aristaflow.adept2.util.io.RereadableContent
close, equals, getInputStream, getSHA512Hash, getSize, getSize, hashCode
-
-
-
-
Constructor Detail
-
FileContent
public FileContent(SwitchingOutputStream sos) throws IOException
Creates a newRereadableContent
based on the designated output stream.- Parameters:
sos
- TheSwitchingOutputStream
providing the data asPath
, its size and its SHA-512 hash.- Throws:
IOException
- If the designated output stream has not been closed yet, anIOException
will be thrown.
-
-
Method Detail
-
createInputStream
protected InputStream createInputStream() throws IOException
Description copied from class:RereadableContent
Creates a new input stream for the content.- Specified by:
createInputStream
in classRereadableContent
- Returns:
- A new input stream for the content. The caller is responsible for closing.
- Throws:
IOException
- If there are problems creating a new input stream for the content, anIOException
will be thrown.
-
-