public static class AbstractOrigin.ByteArrayOrigin extends AbstractOrigin<byte[],AbstractOrigin.ByteArrayOrigin>
byte[] origin.AbstractOrigin.ByteArrayOrigin, AbstractOrigin.CharSequenceOrigin, AbstractOrigin.FileOrigin, AbstractOrigin.InputStreamOrigin, AbstractOrigin.OutputStreamOrigin, AbstractOrigin.PathOrigin, AbstractOrigin.ReaderOrigin, AbstractOrigin.URIOrigin, AbstractOrigin.WriterOrigin| Constructor and Description |
|---|
ByteArrayOrigin(byte[] origin)
Constructs a new instance for the given origin.
|
| Modifier and Type | Method and Description |
|---|---|
byte[] |
getByteArray()
Gets this origin as a byte array, if possible.
|
InputStream |
getInputStream(OpenOption... options)
Gets this origin as an InputStream, if possible.
|
Reader |
getReader(Charset charset)
Gets a new Reader on the origin, buffered by default.
|
long |
size()
Gets the size of the origin, if possible.
|
get, getByteArray, getCharSequence, getFile, getOutputStream, getPath, getWriter, toStringasThisclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitasSupplierpublic ByteArrayOrigin(byte[] origin)
origin - The origin.public byte[] getByteArray()
AbstractOrigingetByteArray in class AbstractOrigin<byte[],AbstractOrigin.ByteArrayOrigin>public InputStream getInputStream(OpenOption... options) throws IOException
AbstractOrigingetInputStream in class AbstractOrigin<byte[],AbstractOrigin.ByteArrayOrigin>options - options specifying how the file is openedIOException - if an I/O error occurs.public Reader getReader(Charset charset) throws IOException
AbstractOrigingetReader in class AbstractOrigin<byte[],AbstractOrigin.ByteArrayOrigin>charset - the charset to use for decodingIOException - if an I/O error occurs opening the file.public long size() throws IOException
AbstractOriginsize in class AbstractOrigin<byte[],AbstractOrigin.ByteArrayOrigin>IOException - if an I/O error occurs.Copyright © 2002–2023 The Apache Software Foundation. All rights reserved.