Package tech.tablesaw.io
Class Source
- java.lang.Object
-
- tech.tablesaw.io.Source
-
public class Source extends Object
-
-
Field Summary
Fields Modifier and Type Field Description protected Charset
charset
protected File
file
protected InputStream
inputStream
protected Reader
reader
-
Constructor Summary
Constructors Constructor Description Source(File file)
Source(File file, Charset charset)
Source(InputStream inputStream)
Source(InputStreamReader reader)
Source(InputStream inputStream, Charset charset)
Source(Reader reader)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Reader
createReader(byte[] cachedBytes)
If cachedBytes are not null, returns a Reader created from the cachedBytes.File
file()
static Source
fromString(String s)
static Source
fromUrl(String url)
Charset
getCharset()
InputStream
inputStream()
Reader
reader()
-
-
-
Field Detail
-
file
protected final File file
-
reader
protected final Reader reader
-
inputStream
protected final InputStream inputStream
-
charset
protected final Charset charset
-
-
Constructor Detail
-
Source
public Source(File file)
-
Source
public Source(InputStreamReader reader)
-
Source
public Source(Reader reader)
-
Source
public Source(InputStream inputStream)
-
Source
public Source(InputStream inputStream, Charset charset)
-
-
Method Detail
-
fromUrl
public static Source fromUrl(String url) throws IOException
- Throws:
IOException
-
file
public File file()
-
reader
public Reader reader()
-
inputStream
public InputStream inputStream()
-
getCharset
public Charset getCharset()
-
createReader
public Reader createReader(byte[] cachedBytes) throws IOException
If cachedBytes are not null, returns a Reader created from the cachedBytes. Otherwise, returns a Reader from the underlying source.- Throws:
IOException
-
-