Package de.aristaflow.adept2.util.io
Class WrappingContent
- java.lang.Object
-
- de.aristaflow.adept2.util.io.RereadableContent
-
- de.aristaflow.adept2.util.io.WrappingContent
-
- All Implemented Interfaces:
Closeable
,AutoCloseable
public class WrappingContent extends RereadableContent
ARereadableContent
based on anotherRereadableContent
. It has its ownRrcInputStream
to prevent the wrappedRereableContent
from cleaning-up.
-
-
Nested Class Summary
-
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 RereadableContent
rrc
The wrappedRereadableContent
.-
Fields inherited from class de.aristaflow.adept2.util.io.RereadableContent
cleanup, existingStreams, finalCleanup, RRC_INPUT_STREAM_SIZE, sha512hash, size
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
WrappingContent(RereadableContent.RrcInputStream rrcIs)
Creates a newWrappingContent
for the designated input stream withRereadableContent
.
-
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
-
-
-
-
Field Detail
-
rrc
protected final RereadableContent rrc
The wrappedRereadableContent
.
-
-
Constructor Detail
-
WrappingContent
protected WrappingContent(RereadableContent.RrcInputStream rrcIs) throws IOException
Creates a newWrappingContent
for the designated input stream withRereadableContent
.- Parameters:
rrcIs
- The input stream created by the wrappedRereadableContent
. The caller is responsible for closing.- Throws:
IOException
- If creating a new input stream from the wrappedRereadableContent
fails, 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.
-
-