|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.io.InputStream
eneter.messaging.dataprocessing.streaming.DynamicInputStream
public class DynamicInputStream
Stream which can be written and read at the same time. The dynamic stream supports writing of data by one thread and reading by another. The reading operation is blocked until the requested amount of data is not available.
Constructor Summary | |
---|---|
DynamicInputStream()
|
Method Summary | |
---|---|
void |
close()
Closes the stream and releases the reading thread waiting for data. |
boolean |
getBlockingMode()
Gets the blocking mode. |
int |
read()
Reads one byte from the stream. |
int |
read(byte[] buffer,
int offset,
int count)
Reads data from the stream to the specified buffer. |
void |
setBlockingMode(boolean isBlocking)
Gets the blocking mode. |
void |
write(byte[] buffer,
int offset,
int count)
Writes the data to the stream. |
void |
writeWithoutCopying(byte[] data,
int offset,
int count)
Writes data to the stream the way that it just stores the reference to the input data. |
Methods inherited from class java.io.InputStream |
---|
available, mark, markSupported, read, reset, skip |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DynamicInputStream()
Method Detail |
---|
public void setBlockingMode(boolean isBlocking)
isBlocking
- true if the reading shall be blocking until data is available.public boolean getBlockingMode()
public int read() throws java.io.IOException
read
in class java.io.InputStream
java.io.IOException
public int read(byte[] buffer, int offset, int count) throws java.io.IOException
read
in class java.io.InputStream
java.io.IOException
public void write(byte[] buffer, int offset, int count)
buffer
- Buffer to be written to the streamoffset
- Starting podition in the buffer from where data will be read.count
- Amount of data to be read from the buffer and written to the stream.public void writeWithoutCopying(byte[] data, int offset, int count)
data
- data to be written to the stream.offset
- Starting position in the buffer from where data will be read.count
- Amount of data to be read from the buffer and written to the stream.public void close()
close
in interface java.io.Closeable
close
in class java.io.InputStream
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |