|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
public interface IterativeReader
Interface specifying read from a stream in small chunks. This interface specifies an Object to read from an InputStream in small chunks. An IterativeReader class can support the directio package's features of Sharing an InputStream with another reader and providing an OutputStream to save directly for the IterativeReader to read.
mediautil.gen.directio,
SplitInputStream,
OutStreamToIterativeReader| Field Summary | |
|---|---|
static int |
CONTINUE
Constant which specifies that the IterativeReader/IterativeWriter is not done with nextRead/nextWrite. |
static int |
STOP
Constant which specifies that the IterativeReader/IterativeWriter is done with nextRead/nextWrite. |
| Method Summary | |
|---|---|
int |
nextRead(int numBytes)
Specifies that numBytes bytes are to be read. |
| Field Detail |
|---|
static final int CONTINUE
static final int STOP
| Method Detail |
|---|
int nextRead(int numBytes)
throws IOException
numBytes - Number of bytes to read. This is only indicative. The
implementor may read more or less. Reading too less impacts performance
due to repeated nextRead calls. Reading too much more than numBytes leads
to performance impact due to buffer reallocation in case of
SplitInputStream and an IOException due to Empty Buffer in an
OutStreamToIterativeReader.
The InputStream returned for use by an IterativeReader by directio's
classes implement ByteCounter which can help in keeping track of
the number of bytes read or remaining during a nextRead call.
CONTINUE to indicate that there is more to be read and
STOP to indicate that the IterativeReader is done with reading.
IOException - In case of an error during read. Note that data
errors can also be handled by returning STOP and storing the error
instead of throwing an Exception. This may be desirable for a
SplitInputStream since the main Read can continue unhindered by the
SubStream's error.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||