public abstract class BeanCharSource extends CharSource implements org.joda.beans.ImmutableBean
See StringCharSource.
Various methods override CharSource to throw UncheckedIOException instead of IOException.
| Modifier | Constructor and Description |
|---|---|
protected |
BeanCharSource()
Creates an instance.
|
| Modifier and Type | Method and Description |
|---|---|
BeanByteSource |
asByteSource(Charset charset) |
BeanByteSource |
asByteSourceUtf8()
Converts this char source to a byte source in UTF-8.
|
void |
forEachLine(Consumer<? super String> action) |
Optional<String> |
getFileName()
Gets the file name of the source.
|
String |
getFileNameOrThrow()
Gets the file name of the source.
|
boolean |
isEmpty() |
long |
length() |
Stream<String> |
lines() |
StringCharSource |
load()
Loads the content of the source into memory.
|
String |
read() |
String |
readFirstLine() |
ImmutableList<String> |
readLines() |
<T> T |
readLines(LineProcessor<T> processor) |
concat, concat, concat, copyTo, copyTo, empty, lengthIfKnown, openBufferedStream, openStream, wrappublic Optional<String> getFileName()
Most sources originate from a file-based location. This is captured and returned here where available.
public String getFileNameOrThrow()
Most sources originate from a file-based location. This is captured and returned here where available.
IllegalArgumentException - if the file name is not knownpublic Stream<String> lines()
lines in class CharSourcepublic boolean isEmpty()
isEmpty in class CharSourcepublic long length()
length in class CharSourcepublic String read()
read in class CharSourcepublic String readFirstLine()
readFirstLine in class CharSourcepublic ImmutableList<String> readLines()
readLines in class CharSourcepublic <T> T readLines(LineProcessor<T> processor)
readLines in class CharSourcepublic void forEachLine(Consumer<? super String> action)
forEachLine in class CharSourcepublic StringCharSource load()
UncheckedIOException - if an IO error occurspublic BeanByteSource asByteSourceUtf8()
public BeanByteSource asByteSource(Charset charset)
asByteSource in class CharSourceCopyright 2009-Present by OpenGamma Inc. and individual contributors
Apache v2 licensed
Additional documentation can be found at strata.opengamma.io.