From: Serge Savoie Date: 2008-09-30T09:14:53+09:00 Subject: Re: Ruby Socket to Java Socket Thx jim... we have finally made it by programming a little gateway that talk with "ordinary" output stream to the outside world (Ruby) and translate to his older brother that talk with pure Java stream... Jim Morris wrote: > Serge Savoie wrote: >> requestSocket.getInputStream() ) ); >> >> And in this case I get : >> >> java.io.StreamCorruptedException: invalid stream header >> at >> java.io.ObjectInputStream.readStreamHeader(ObjectInputStream.java:753) >> at java.io.ObjectInputStream.(ObjectInputStream.java:268) >> at project1.SergeServer1.main(SergeServer1.java:44) >> > > The Java server is reading a Marshalled Java object, Usually that will > only be used for two Java > processes talking to each other. > > If you are sending very simple Java Objects you could format it in Ruby > and transmit it, but it > would be messy. You will have to read the Sun documents on Java > serialized object formats, look at > the ObjectInputStream Javadoc for references to the required formats. > > Try using JRuby instead and serialize the Java object in Java. -- Posted via http://www.ruby-forum.com/.