public abstract static class Input.MultiInput extends Input implements java.lang.AutoCloseable
Input.ArchiveMultiInput, Input.FolderMultiInput, Input.MultiInput, Input.PathArchiveMultiInput, Input.PipeArchiveMultiInput, Input.SingleInput| Constructor and Description |
|---|
MultiInput() |
| Modifier and Type | Method and Description |
|---|---|
static Input.MultiInput |
archive(ArchiveFormat format,
byte[] bytes)
Create a
Input.MultiInput which reads from an array of bytes. |
static Input.MultiInput |
archive(ArchiveFormat format,
java.io.InputStream stream)
Create a
Input.MultiInput which reads from an existing stream. |
static Input.MultiInput |
archive(ArchiveFormat format,
java.nio.file.Path path)
Create a
Input.MultiInput which reads from an archive file. |
abstract void |
close() |
static Input.MultiInput |
detectedArchive(java.nio.file.Path path)
Create a
Input.MultiInput which reads from an archive file. |
static Input.MultiInput |
folder(java.nio.file.Path folder)
Create a
Input.MultiInput which reads from a folder. |
abstract java.util.Set<java.lang.String> |
index()
Get the index for this input.
|
abstract void |
open(java.lang.String prefix)
Called to open any internal resources and set up the input for reading.
|
byte[] |
read(java.lang.String key)
Read the given entry as an array of bytes.
|
java.util.List<java.lang.String> |
readLines(java.lang.String key)
Read the given entry as a List of Strings.
|
abstract byte[] |
tryRead(java.lang.String key)
Try and read the given entry as an array of bytes.
|
public static Input.MultiInput archive(ArchiveFormat format, java.nio.file.Path path)
Input.MultiInput which reads from an archive file.format - The format of the archive.path - The path.public static Input.MultiInput detectedArchive(java.nio.file.Path path) throws java.lang.IllegalArgumentException
Input.MultiInput which reads from an archive file.
Will attempt to automatically detect the archive format based on file name.
If the format can not be detected it will throw a IllegalArgumentException
path - The path.java.lang.IllegalArgumentException - If the format cannot be detected.public static Input.MultiInput archive(ArchiveFormat format, byte[] bytes)
Input.MultiInput which reads from an array of bytes.format - The format of the archive.bytes - The bytes.public static Input.MultiInput archive(ArchiveFormat format, java.io.InputStream stream)
Input.MultiInput which reads from an existing stream.format - The format of the archive.stream - The path.public static Input.MultiInput folder(java.nio.file.Path folder)
Input.MultiInput which reads from a folder.folder - The folder.public abstract void open(java.lang.String prefix)
throws java.io.IOException
prefix - A prefix directory to read from.java.io.IOExceptionpublic abstract java.util.Set<java.lang.String> index()
throws java.io.IOException
java.io.IOExceptionpublic java.util.List<java.lang.String> readLines(java.lang.String key)
throws java.io.IOException
key - The entry to read.java.io.IOExceptionpublic byte[] read(java.lang.String key)
throws java.io.IOException
key - The entry to read.java.io.IOExceptionpublic abstract byte[] tryRead(java.lang.String key)
throws java.io.IOException
key - The entry to read.null.java.io.IOExceptionpublic abstract void close()
throws java.io.IOException
close in interface java.lang.AutoCloseablejava.io.IOException