T - the type of data this reader expectspublic abstract class InputStreamDataReader<T> extends AbstractDataReader<T>
DataReader
implementations that rely on InputStreams. Common functionality includes the
handling of a Converter, translating the InputStream data
into Object(s)| Constructor and Description |
|---|
InputStreamDataReader()
Create an InputStreamDataReader without any configuration options
|
InputStreamDataReader(InputStreamConverter<T> converter)
Create an InputStreamDataReader and assign a
Converter to this. |
InputStreamDataReader(java.io.InputStream is,
InputStreamConverter<T> converter)
Create an InputStreamDataReader, set the
InputStream and
assign a Converter to this. |
| Modifier and Type | Method and Description |
|---|---|
T |
get()
Obtain the next entity of data.
|
InputStreamConverter<T> |
getConverter()
Get the converter that is used by this InputStreamDataReader.
|
java.io.InputStream |
getInputStream()
Return the InputStream used by this InputStreamDataReader.
|
boolean |
next()
Check if more data is available on this DataReader.
|
void |
setConverter(InputStreamConverter<T> converter)
Set the converter that will convert the raw data into object(s) of type T.
|
void |
setInputStream(java.io.InputStream is)
Explicitly set the InputStream for this InputStreamDataReader.
|
iteratorpublic InputStreamDataReader()
public InputStreamDataReader(InputStreamConverter<T> converter)
Converter to this.converter - the Converter that will be used to convert raw
data into object(s) of type Tpublic InputStreamDataReader(java.io.InputStream is,
InputStreamConverter<T> converter)
throws java.io.IOException
InputStream and
assign a Converter to this.
Once the InputStream is supplied, the setInputStream(java.io.InputStream)
method will be called, which will also initialize the InputStream.is - the InputStream containing the data for this InputStreamReaderconverter - the Converter that will be used to convert raw
data into object(s) of type Tjava.io.IOException - in case the initialization of the InputStream fails.public void setConverter(InputStreamConverter<T> converter)
converter - the Converter that will be used to convert raw
data into object(s) of type Tpublic InputStreamConverter<T> getConverter()
setConverter(io.datafx.io.converter.InputStreamConverter)
method.public void setInputStream(java.io.InputStream is)
throws java.io.IOException
Converter to
decide what to do upon initialization (e.g. checking headers).is - the InputStream that will be initialized.java.io.IOException - in case initialization of the InputStream fails.public java.io.InputStream getInputStream()
setInputStream(java.io.InputStream) method.public T get()
DataReaderpublic boolean next()
DataReader