Package org.apache.commons.io.build
Class AbstractOrigin.ByteArrayOrigin
java.lang.Object
org.apache.commons.io.build.AbstractSupplier<byte[],AbstractOrigin.ByteArrayOrigin>
 
org.apache.commons.io.build.AbstractOrigin<byte[],AbstractOrigin.ByteArrayOrigin>
 
org.apache.commons.io.build.AbstractOrigin.ByteArrayOrigin
- All Implemented Interfaces:
- IOSupplier<byte[]>
- Enclosing class:
- AbstractOrigin<T,- B extends AbstractOrigin<T, - B>> 
public static class AbstractOrigin.ByteArrayOrigin
extends AbstractOrigin<byte[],AbstractOrigin.ByteArrayOrigin> 
A 
byte[] origin.- 
Nested Class SummaryNested classes/interfaces inherited from class org.apache.commons.io.build.AbstractOriginAbstractOrigin.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 SummaryConstructorsConstructorDescriptionByteArrayOrigin(byte[] origin) Constructs a new instance for the given origin.
- 
Method SummaryModifier 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.longsize()Gets the size of the origin, if possible.Methods inherited from class org.apache.commons.io.build.AbstractOriginget, getByteArray, getCharSequence, getFile, getOutputStream, getPath, getRandomAccessFile, getWriter, toStringMethods inherited from class org.apache.commons.io.build.AbstractSupplierasThisMethods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.apache.commons.io.function.IOSupplierasSupplier, getUnchecked
- 
Constructor Details- 
ByteArrayOriginConstructs a new instance for the given origin.- Parameters:
- origin- The origin, not null.
 
 
- 
- 
Method Details- 
getByteArrayDescription copied from class:AbstractOriginGets this origin as a byte array, if possible.- Overrides:
- getByteArrayin class- AbstractOrigin<byte[],- AbstractOrigin.ByteArrayOrigin> 
- Returns:
- this origin as a byte array, if possible.
 
- 
getInputStreamGets this origin as an InputStream, if possible.The optionsparameter is ignored since abyte[]does not need anOpenOptionto be read.- Overrides:
- getInputStreamin class- AbstractOrigin<byte[],- AbstractOrigin.ByteArrayOrigin> 
- 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.
 
- 
getReaderDescription copied from class:AbstractOriginGets a new Reader on the origin, buffered by default.- Overrides:
- getReaderin class- AbstractOrigin<byte[],- AbstractOrigin.ByteArrayOrigin> 
- Parameters:
- charset- the charset to use for decoding, null maps to the default Charset.
- Returns:
- a new Reader on the origin.
- Throws:
- IOException- if an I/O error occurs opening the file.
 
- 
sizeDescription copied from class:AbstractOriginGets the size of the origin, if possible.- Overrides:
- sizein class- AbstractOrigin<byte[],- AbstractOrigin.ByteArrayOrigin> 
- Returns:
- the size of the origin in bytes or characters.
- Throws:
- IOException- if an I/O error occurs.
 
 
-