Package org.apache.commons.io.build
Class AbstractOrigin.InputStreamOrigin
java.lang.Object
org.apache.commons.io.build.AbstractSupplier<T,B>
org.apache.commons.io.build.AbstractOrigin<InputStream,AbstractOrigin.InputStreamOrigin>
org.apache.commons.io.build.AbstractOrigin.InputStreamOrigin
- All Implemented Interfaces:
IOSupplier<InputStream>
- Enclosing class:
- AbstractOrigin<T,
B extends AbstractOrigin<T, B>>
public static class AbstractOrigin.InputStreamOrigin
extends AbstractOrigin<InputStream,AbstractOrigin.InputStreamOrigin>
An
InputStream
origin.
This origin cannot provide some of the other aspects.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.commons.io.build.AbstractOrigin
AbstractOrigin.AbstractRandomAccessFileOrigin<T extends RandomAccessFile,
B extends AbstractOrigin.AbstractRandomAccessFileOrigin<T, B>>, AbstractOrigin.ByteArrayOrigin, AbstractOrigin.CharSequenceOrigin, AbstractOrigin.FileOrigin, AbstractOrigin.InputStreamOrigin, AbstractOrigin.IORandomAccessFileOrigin, AbstractOrigin.OutputStreamOrigin, AbstractOrigin.PathOrigin, AbstractOrigin.RandomAccessFileOrigin, AbstractOrigin.ReaderOrigin, AbstractOrigin.URIOrigin, AbstractOrigin.WriterOrigin -
Constructor Summary
ConstructorDescriptionInputStreamOrigin
(InputStream origin) Constructs a new instance for the given origin. -
Method Summary
Modifier and TypeMethodDescriptionbyte[]
Gets this origin as a byte array, if possible.getInputStream
(OpenOption... options) Gets this origin as an InputStream, if possible.Gets a new Reader on the origin, buffered by default.Methods inherited from class org.apache.commons.io.build.AbstractOrigin
get, getByteArray, getCharSequence, getFile, getOutputStream, getPath, getRandomAccessFile, getWriter, size, toString
Methods inherited from class org.apache.commons.io.build.AbstractSupplier
asThis
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.apache.commons.io.function.IOSupplier
asSupplier, getUnchecked
-
Constructor Details
-
InputStreamOrigin
Constructs a new instance for the given origin.- Parameters:
origin
- The origin.
-
-
Method Details
-
getByteArray
Description copied from class:AbstractOrigin
Gets this origin as a byte array, if possible.- Overrides:
getByteArray
in classAbstractOrigin<InputStream,
AbstractOrigin.InputStreamOrigin> - Returns:
- this origin as a byte array, if possible.
- Throws:
IOException
- if an I/O error occurs.
-
getInputStream
Gets this origin as an InputStream, if possible.The
options
parameter is ignored since aInputStream
does not need anOpenOption
to be read.- Overrides:
getInputStream
in classAbstractOrigin<InputStream,
AbstractOrigin.InputStreamOrigin> - Parameters:
options
- options specifying how the file is opened- Returns:
- this origin as an InputStream, if possible.
-
getReader
Description copied from class:AbstractOrigin
Gets a new Reader on the origin, buffered by default.- Overrides:
getReader
in classAbstractOrigin<InputStream,
AbstractOrigin.InputStreamOrigin> - Parameters:
charset
- the charset to use for decoding- Returns:
- a new Reader on the origin.
- Throws:
IOException
- if an I/O error occurs opening the file.
-