public class DataStreamProducer extends Object implements DataProducer
A DataProducer which reads the data from an InputStream.
| Constructor and Description |
|---|
DataStreamProducer(InputStream in,
String name)
Creates a producer.
|
| Modifier and Type | Method and Description |
|---|---|
String |
getName()
Returns the name of the producer in the exception (if one is thrown).
|
int |
produce(byte[] buffer)
Produces the data.
|
public DataStreamProducer(InputStream in, String name)
Creates a producer.
in - The input stream.name - The name of the producer in the exception (if one is thrown).IllegalArgumentException - If any of the parameters are null.public String getName()
DataProducerReturns the name of the producer in the exception (if one is thrown).
getName in interface DataProducerpublic int produce(byte[] buffer)
throws IOException
DataProducerProduces the data.
produce in interface DataProducerbuffer - The buffer which is filled with the data.-1, if the end of the produced data is reached.IOException - If an I/O error occurs.Copyright © 2015–2019. All rights reserved.