public abstract class BeanByteSource extends ByteSource implements org.joda.beans.ImmutableBean
See ArrayByteSource, UriByteSource and FileByteSource.
| Modifier | Constructor and Description |
|---|---|
protected |
BeanByteSource()
Creates an instance.
|
| Modifier and Type | Method and Description |
|---|---|
CharSource |
asCharSourceUtf8()
Returns a
CharSource for the same bytes, converted to UTF-8. |
CharSource |
asCharSourceUtf8UsingBom()
Returns a
CharSource for the File, converted to UTF-8 using a Byte-Order Mark if available. |
boolean |
isEmpty()
Checks if the byte source is empty, throwing an unchecked exception.
|
ArrayByteSource |
load()
Loads the content of the byte source into memory.
|
byte[] |
read()
Reads the source as a byte array, throwing an unchecked exception.
|
String |
readUtf8()
Reads the source, converting to UTF-8.
|
String |
readUtf8UsingBom()
Reads the source, converting to UTF-8 using a Byte-Order Mark if available.
|
long |
size()
Gets the size of the byte source, throwing an unchecked exception.
|
asCharSource, concat, concat, concat, contentEquals, copyTo, copyTo, empty, hash, openBufferedStream, openStream, read, sizeIfKnown, slice, wrappublic boolean isEmpty()
This overrides ByteSource to throw UncheckedIOException instead of IOException.
isEmpty in class ByteSourceUncheckedIOException - if an IO error occurspublic long size()
This overrides ByteSource to throw UncheckedIOException instead of IOException.
size in class ByteSourceUncheckedIOException - if an IO error occurspublic byte[] read()
This overrides ByteSource to throw UncheckedIOException instead of IOException.
read in class ByteSourceUncheckedIOException - if an IO error occurspublic String readUtf8()
UncheckedIOException - if an IO error occurspublic String readUtf8UsingBom()
UncheckedIOException - if an IO error occurspublic CharSource asCharSourceUtf8()
CharSource for the same bytes, converted to UTF-8.
This does not read the underlying source.
CharSourcepublic CharSource asCharSourceUtf8UsingBom()
CharSource for the File, converted to UTF-8 using a Byte-Order Mark if available.CharSourcepublic ArrayByteSource load()
UncheckedIOException - if an IO error occursCopyright 2009-Present by OpenGamma Inc. and individual contributors
Apache v2 licensed
Additional documentation can be found at strata.opengamma.io.