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
public class ReadableResourceInputStream extends AbstractMemoryReadableResource
An in-memoryIReadableResourcebased on anInputStream.- Author:
- Philip Helger
-
-
Constructor Summary
Constructors Constructor Description ReadableResourceInputStream(String sResourceID, InputStream aIS)Constructor to use.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description InputStreamgetInputStream()Get the input stream to read from the object.booleanisReadMultiple()Check if theInputStreamfromIHasInputStream.getInputStream()andIHasInputStream.getBufferedInputStream()can be acquired more than once.StringtoString()-
Methods inherited from class com.helger.commons.io.resource.inmemory.AbstractMemoryReadableResource
exists, getAsFile, getAsURL, getPath, getReadableCloneForPath, getResourceID
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.helger.commons.io.IHasInputStream
getBufferedInputStream
-
Methods inherited from interface com.helger.commons.io.IHasInputStreamAndReader
getBufferedReader, getReader
-
-
-
-
Constructor Detail
-
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 Detail
-
getInputStream
@Nonnull public final InputStream 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
public String toString()
- Overrides:
toStringin classAbstractMemoryReadableResource
-
-