wood burning stoves 2.0*
The moose likes I/O and Streams and the fly likes Problem using ObjectOutputStreams writeObject(), heeelp. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » I/O and Streams
Reply locked New topic
Author

Problem using ObjectOutputStreams writeObject(), heeelp.

Dominic Steng�rd
Ranch Hand

Joined: Feb 05, 2001
Posts: 186
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);
}
}
}


Dominic Steng�rd<br />Sun Certified Java 2 Programmer
Joe Ess
Bartender

Joined: Oct 29, 2001
Posts: 8971
    
    9

Please do not crosspost your questions to more than one forum.


[How To Ask Questions On JavaRanch]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Problem using ObjectOutputStreams writeObject(), heeelp.