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
ARereadableContentbased on anotherRereadableContent. It has its ownRrcInputStreamto prevent the wrappedRereableContentfrom 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 RereadableContentrrcThe 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 protectedWrappingContent(RereadableContent.RrcInputStream rrcIs)Creates a newWrappingContentfor the designated input stream withRereadableContent.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected InputStreamcreateInputStream()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 newWrappingContentfor 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 wrappedRereadableContentfails, anIOExceptionwill be thrown.
-
-
Method Detail
-
createInputStream
protected InputStream createInputStream() throws IOException
Description copied from class:RereadableContentCreates a new input stream for the content.- Specified by:
createInputStreamin 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, anIOExceptionwill be thrown.
-
-