public class DataSourceStream extends java.lang.Object implements DataSource
Modifier and Type | Field and Description |
---|---|
protected int |
bufferSize |
private static int |
DEFAULT_BUFFER_SIZE |
protected java.io.InputStream |
in |
protected long |
totalRead |
Constructor and Description |
---|
DataSourceStream(java.io.InputStream in) |
DataSourceStream(java.io.InputStream in,
int bufferSize) |
Modifier and Type | Method and Description |
---|---|
void |
close()
Closes this data source and releases any system
resources associated with this source.
|
Buffer |
read()
Reads a data buffer from this data source.
|
long |
totalSize()
Optional operation.
|
private static final int DEFAULT_BUFFER_SIZE
protected java.io.InputStream in
protected int bufferSize
protected long totalRead
public DataSourceStream(java.io.InputStream in)
public DataSourceStream(java.io.InputStream in, int bufferSize)
public Buffer read() throws java.io.IOException
DataSource
read
in interface DataSource
java.io.IOException
- if an I/O error occurs.public void close() throws java.io.IOException
DataSource
close
in interface DataSource
java.io.IOException
- if an I/O error occurs.public long totalSize()
DataSource
totalSize
in interface DataSource