0
What is the use of Java Selector?
i want to understand the I/O communication with synchronization using socket channels and selectors
1 Odpowiedź
0
Maybe this is a little bit late, but of what I've read you'd need a pipedputstream and connect to a pipedinputstream.
You can connect them using the inputstreams conmect method.
Then you can write from one thread to the output stream and read the data from inputstream from an other thread.
https://docs.oracle.com/javase/7/docs/api/java/io/PipedInputStream.html
If want to pass objects you could wrap them in object input/output streams.