Bookmark Topic Watch Topic
  • New Topic

Problem using ObjectOutputStreams writeObject(), heeelp.

 
Dominic Steng�rd
Ranch Hand
Posts: 186
  • Mark post as helpful
  • send pies
  • Report post to moderator
When I call networkOut.writeObject(storage) bellow nothing happens. No exception or nothing, the program just seems to freeze at this point. The storage object contains a byte [] array with a soundsnippet recorded from the computers microphone.

Any thought will be appreciated, since Im clueless.
Thanks in advance.

--------

import java.io.*;
import java.net.*;

public class OutputThread implements Runnable {

private Socket socket;
private ObjectOutputStream networkOut;
private ByteArrayOutputStream bA;
private Storage storage;
private Uppgift6_2_1 p;

public OutputThread(Socket socket, ByteArrayOutputStream bA, Uppgift6_2_1 p) {
this.socket = socket;
this.bA = bA;
this.p = p;
storage = new Storage(bA);
}

public void run() {
try {
networkOut = new ObjectOutputStream(socket.getOutputStream());
p.setText("Uuurk");
networkOut.writeObject(storage);
p.setText("Slurk");
networkOut.flush();
p.setText("Wooha");
}
catch(IOException e) {
System.err.println(e);
}
}
}
 
Joe Ess
Bartender
Posts: 9312
10
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Report post to moderator
Please do not crosspost your questions to more than one forum.
 
    Bookmark Topic Watch Topic
  • New Topic