Hook up an ObjectOutputStream to a corresponding ObjectInputStream

  • Thread starter Thread starter 0rthodontist
  • Start date Start date
AI Thread Summary
In Java, connecting an ObjectOutputStream to a corresponding ObjectInputStream without a socket can be achieved using PipedOutputStreams. This method allows for the abstraction of streams while maintaining the ability for objects to interact with their neighbors without direct references. The goal is to avoid requiring objects to have prior knowledge of their connections. The user initially sought a solution for managing object interactions more abstractly. Ultimately, the problem was resolved with the use of PipedOutputStreams.
0rthodontist
Science Advisor
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:
Thread 'Have I solved this structural engineering equation correctly?'
Hi all, I have a structural engineering book from 1979. I am trying to follow it as best as I can. I have come to a formula that calculates the rotations in radians at the rigid joint that requires an iterative procedure. This equation comes in the form of: $$ x_i = \frac {Q_ih_i + Q_{i+1}h_{i+1}}{4K} + \frac {C}{K}x_{i-1} + \frac {C}{K}x_{i+1} $$ Where: ## Q ## is the horizontal storey shear ## h ## is the storey height ## K = (6G_i + C_i + C_{i+1}) ## ## G = \frac {I_g}{h} ## ## C...
Back
Top