Package org.jppf.utils.streams
Class MultipleBuffersInputStream
java.lang.Object
java.io.InputStream
org.jppf.utils.streams.MultipleBuffersInputStream
- All Implemented Interfaces:
Closeable,AutoCloseable
An output stream implementation that minimizes memory usage.
- Author:
- Laurent Cohen
-
Constructor Summary
ConstructorsConstructorDescriptionMultipleBuffersInputStream(JPPFBuffer[] buffers) Initialize this input stream with the specified buffers. -
Method Summary
Methods inherited from class java.io.InputStream
available, close, mark, markSupported, nullInputStream, readAllBytes, readNBytes, readNBytes, reset, skip, skipNBytes, transferTo
-
Constructor Details
-
MultipleBuffersInputStream
Initialize this input stream with the specified buffers.- Parameters:
buffers- an array ofJPPFBufferinstances.
-
-
Method Details
-
read
Read a single byte from this input stream.- Specified by:
readin classInputStream- Returns:
- the data read.
- Throws:
IOException- if any error occurs.
-
read
Read from this input stream into the specified byte array.- Overrides:
readin classInputStream- Parameters:
b- buffer that receives the data read form this stream.off- the start offset in the buffer.len- the number of bytes to read.- Returns:
- the number of bytes read from the stream, or -1 if end of file was reached.
- Throws:
IOException- if any error occurs.
-
read
Read from this input stream into the specified byte array.- Overrides:
readin classInputStream- Parameters:
b- buffer that receives the data read form this stream.- Returns:
- the number of bytes read from the stream, or -1 if end of file was reached.
- Throws:
IOException- if any error occurs.
-
toString
-