Package de.aristaflow.adept2.util.io
Class MemoryContent
- java.lang.Object
-
- de.aristaflow.adept2.util.io.RereadableContent
-
- de.aristaflow.adept2.util.io.MemoryContent
-
- All Implemented Interfaces:
Closeable,AutoCloseable
public class MemoryContent extends RereadableContent
ARereadableContentbased on memory data.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static classMemoryContent.MutableNullerThis class implements the cleanup (nulling the byte array) without referring to theRereadableContentit cleans up.-
Nested classes/interfaces inherited from class de.aristaflow.adept2.util.io.RereadableContent
RereadableContent.RrcCleanup, RereadableContent.RrcInputStream
-
-
Field Summary
-
Fields inherited from class de.aristaflow.adept2.util.io.RereadableContent
cleanup, existingStreams, finalCleanup, RRC_INPUT_STREAM_SIZE, sha512hash, size
-
-
Constructor Summary
Constructors Constructor Description MemoryContent(SwitchingOutputStream sos)Creates a newRereadableContentbased on the designated output stream.
-
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
-
-
-
-
Constructor Detail
-
MemoryContent
public MemoryContent(SwitchingOutputStream sos) throws IOException
Creates a newRereadableContentbased on the designated output stream.- Parameters:
sos- TheSwitchingOutputStreamproviding the data, its size and its SHA-512 hash.- Throws:
IOException- If the designated output stream has not been closed yet, anIOExceptionwill be thrown.
-
-
Method Detail
-
createInputStream
protected InputStream createInputStream()
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.
-
-