I hava got 2 Threads in java and I want hook up them. I used class PipedInputStream and PipedOutputStream, but I want sending objects, how I do it?
Thank you
I hava got 2 Threads in java and I want hook up them. I
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Why not use a
Queue. The producer cam pump objects on the queue which the consumer can receive and process.There are several implementations of
BlockingQueuewhich you can use in java, for exampleLinkedBlockingQueue.You have to elaborate if you have any specific use case.