This content has been marked as final. Show 3 replies
I cannot seem to use ObjectInputStream and ObjectOutputStream with them.That does work, but there are gotchas:
1. They block more readily than sockets because the internal buffer is only 4k instead of at least 8k at both ends of a socket, more like 90k in total if there are no Windows platforms involved.
2. You must create the pipes themselves first, connected together; then start the reading thread; then construct the ObjectOutputStream around the PipedOutputStream; the reading thread must construct the ObjectInputStream around the PipedInputStream in its run method. Otherwise things will jam or fail in various ways due to the object stream header, and the requirement to have the pipes connected to each other, and a read thread in existence when you write.