Class ReadableResourceInputStream
java.lang.Object
com.helger.commons.io.resource.inmemory.AbstractMemoryReadableResource
com.helger.commons.io.resource.inmemory.ReadableResourceInputStream
- All Implemented Interfaces:
IHasInputStream,IHasInputStreamAndReader,IMemoryReadableResource,IReadableResource,IResourceBase
An in-memory
IReadableResource based on an InputStream.- Author:
- Philip Helger
-
Constructor Summary
ConstructorsConstructorDescriptionReadableResourceInputStream(String sResourceID, InputStream aIS) Constructor to use. -
Method Summary
Modifier and TypeMethodDescriptionfinal InputStreamGet the input stream to read from the object.final booleanCheck if theInputStreamfromIHasInputStream.getInputStream()andIHasInputStream.getBufferedInputStream()can be acquired more than once.toString()Methods inherited from class com.helger.commons.io.resource.inmemory.AbstractMemoryReadableResource
exists, getAsFile, getAsURL, getPath, getReadableCloneForPath, getResourceIDMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface com.helger.commons.io.IHasInputStream
getBufferedInputStream, withBufferedInputStreamDo, withInputStreamDoMethods inherited from interface com.helger.commons.io.IHasInputStreamAndReader
getBufferedReader, getReader
-
Constructor Details
-
ReadableResourceInputStream
public ReadableResourceInputStream(@Nullable String sResourceID, @Nonnull @WillNotClose InputStream aIS) Constructor to use.- Parameters:
sResourceID- The unique resource ID, used as the caching key.aIS- The InputStream to read from. May not benull. This Stream is NOT closed by this class.
-
-
Method Details
-
getInputStream
Description copied from interface:IHasInputStreamGet the input stream to read from the object. Each time this method is called, a newInputStreamneeds to be created.- Returns:
nullif resolving failed.
-
isReadMultiple
public final boolean isReadMultiple()Description copied from interface:IHasInputStreamCheck if theInputStreamfromIHasInputStream.getInputStream()andIHasInputStream.getBufferedInputStream()can be acquired more than once.- Returns:
trueif the input stream can be acquired more than once,falseif not.
-
toString
- Overrides:
toStringin classAbstractMemoryReadableResource
-