Package org.apache.commons.io.build
Class AbstractOrigin.CharSequenceOrigin
java.lang.Object
org.apache.commons.io.build.AbstractSupplier<CharSequence,AbstractOrigin.CharSequenceOrigin>
org.apache.commons.io.build.AbstractOrigin<CharSequence,AbstractOrigin.CharSequenceOrigin>
org.apache.commons.io.build.AbstractOrigin.CharSequenceOrigin
- All Implemented Interfaces:
IOSupplier<CharSequence>
- Enclosing class:
AbstractOrigin<T,B extends AbstractOrigin<T, B>>
public static class AbstractOrigin.CharSequenceOrigin
extends AbstractOrigin<CharSequence,AbstractOrigin.CharSequenceOrigin>
A
CharSequence origin.-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.commons.io.build.AbstractOrigin
AbstractOrigin.ByteArrayOrigin, AbstractOrigin.CharSequenceOrigin, AbstractOrigin.FileOrigin, AbstractOrigin.InputStreamOrigin, AbstractOrigin.OutputStreamOrigin, AbstractOrigin.PathOrigin, AbstractOrigin.ReaderOrigin, AbstractOrigin.URIOrigin, AbstractOrigin.WriterOrigin -
Constructor Summary
ConstructorsConstructorDescriptionCharSequenceOrigin(CharSequence origin) Constructs a new instance for the given origin. -
Method Summary
Modifier and TypeMethodDescriptionbyte[]Gets this origin as a byte array, if possible.getCharSequence(Charset charset) 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.longsize()Gets the size of the origin, if possible.Methods inherited from class org.apache.commons.io.build.AbstractOrigin
get, getByteArray, getFile, getOutputStream, getPath, getWriter, toStringMethods inherited from class org.apache.commons.io.build.AbstractSupplier
asThisMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.apache.commons.io.function.IOSupplier
asSupplier
-
Constructor Details
-
CharSequenceOrigin
Constructs a new instance for the given origin.- Parameters:
origin- The origin.
-
-
Method Details
-
getByteArray
Description copied from class:AbstractOriginGets this origin as a byte array, if possible.- Overrides:
getByteArrayin classAbstractOrigin<CharSequence,AbstractOrigin.CharSequenceOrigin> - Returns:
- this origin as a byte array, if possible.
-
getCharSequence
Description copied from class:AbstractOriginGets this origin as a byte array, if possible.- Overrides:
getCharSequencein classAbstractOrigin<CharSequence,AbstractOrigin.CharSequenceOrigin> - Parameters:
charset- The charset to use if conversion from bytes is needed.- Returns:
- this origin as a byte array, if possible.
-
getInputStream
Description copied from class:AbstractOriginGets this origin as an InputStream, if possible.- Overrides:
getInputStreamin classAbstractOrigin<CharSequence,AbstractOrigin.CharSequenceOrigin> - Parameters:
options- options specifying how the file is opened- Returns:
- this origin as an InputStream, if possible.
- Throws:
IOException- if an I/O error occurs.
-
getReader
Description copied from class:AbstractOriginGets a new Reader on the origin, buffered by default.- Overrides:
getReaderin classAbstractOrigin<CharSequence,AbstractOrigin.CharSequenceOrigin> - 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.
-
size
Description copied from class:AbstractOriginGets the size of the origin, if possible.- Overrides:
sizein classAbstractOrigin<CharSequence,AbstractOrigin.CharSequenceOrigin> - Returns:
- the size of the origin in bytes or characters.
- Throws:
IOException- if an I/O error occurs.
-