| |
|
| java.lang.Object com.quadcap.util.threads.Stream
Stream | public class Stream (Code) | | This class implements a thread-safe stream data structure, where the
stream has a fixed-size buffer of Objects.
author: Stan Bailes |
Constructor Summary | |
public | Stream() | public | Stream(int maxSize) Construct a new stream with a specified buffer size. |
Method Summary | |
public void | close() Close this stream. | public Object | read() Return the next item from the stream. | public void | write(Object obj) Write an item to the stream. |
Stream | public Stream()(Code) | | Construct a new stream using defaults
|
Stream | public Stream(int maxSize)(Code) | | Construct a new stream with a specified buffer size.
Parameters: maxSize - the maximum number of items to buffer. |
close | public void close()(Code) | | Close this stream.
|
read | public Object read()(Code) | | Return the next item from the stream. Block if the stream's empty.
the next stream item. |
write | public void write(Object obj)(Code) | | Write an item to the stream. Block if the stream buffer is full.
Parameters: obj - the object to write to the stream. |
|
|
|