public class DynamicInputStream
extends java.io.InputStream
Constructor and Description |
---|
DynamicInputStream() |
Modifier and Type | Method and Description |
---|---|
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.
|
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 interface java.lang.AutoCloseable
close
in class java.io.InputStream