public final class FileByteSource extends BeanByteSource implements org.joda.beans.ImmutableBean, Serializable
This implementation differs from Guava in that it is a Joda-Bean.
In addition, BeanByteSource.read() throws UncheckedIOException instead of IOException.
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object other) |
File |
getFile()
Gets the File.
|
int |
hashCode() |
org.joda.beans.MetaBean |
metaBean() |
static FileByteSource |
of(File file)
Creates an instance based on the underlying file.
|
static FileByteSource |
of(Path path)
Creates an instance based on a file path.
|
InputStream |
openStream() |
long |
size()
Gets the size of the byte source, throwing an unchecked exception.
|
Optional<Long> |
sizeIfKnown() |
String |
toString() |
asCharSourceUtf8, asCharSourceUtf8UsingBom, isEmpty, load, read, readUtf8, readUtf8UsingBomasCharSource, concat, concat, concat, contentEquals, copyTo, copyTo, empty, hash, openBufferedStream, read, slice, wrappublic static FileByteSource of(File file)
file - the filepublic static FileByteSource of(Path path)
path - the path to a filepublic org.joda.beans.MetaBean metaBean()
metaBean in interface org.joda.beans.Beanpublic File getFile()
public InputStream openStream() throws IOException
openStream in class ByteSourceIOExceptionpublic Optional<Long> sizeIfKnown()
sizeIfKnown in class ByteSourcepublic long size()
BeanByteSource
This overrides ByteSource to throw UncheckedIOException instead of IOException.
size in class BeanByteSourceCopyright 2009-Present by OpenGamma Inc. and individual contributors
Apache v2 licensed
Additional documentation can be found at strata.opengamma.io.