Hook up an ObjectOutputStream to a corresponding ObjectInputStream

  • Thread starter Thread starter 0rthodontist
  • Start date Start date
Join the discussion
Registration is free. Ask a follow-up in this thread, or start your own.
0 replies · 2K views
Messages
1,229
Reaction score
0
In Java, I want to hook up an ObjectOutputStream to a corresponding ObjectInputStream without a socket in between. My motivation is that I'm going to have a bunch of objects with neigbhors, but the objects will be hooked up to their neighbors by a separate method (the objects should not need to have a priori knowledge of how they are hooked up). How can I do this?

I could just have each object store references to its neighbors, and have functions to interact directly with the neighbors, but I'd prefer the abstraction of a stream if it's possible.

Edit: never mind, I figured it out (PipedOutputStreams).
 
Last edited: