Re: [Javaserver-java] javaserver with binary data
Brought to you by:
zzo
From: <ma...@zz...> - 2004-06-14 22:43:44
|
Got it. Yah you currently can't pass binary data over the JavaServer connexion. Other than encoding the data (base64 would be easy), you can open a socket between the JavaServer process and the perl process & pass the data that way. Check out 'sever.pl' in the perl examples - a ServerSocket & created & opened on the Java side & then lines are passed to it - all from within perl. Mash your ByteArrayInputStream on top of the ServerSocket & you may have something. Mark On Sun, Jun 13, 2004 at 06:38:43PM -0400, Matt Greenwood wrote: > Mark, > My Java objects are zipped together in a zip file. I use perl to > iterate through the entries. For each entry I have an $entry->contents > that I want to pass to the Java side. My original workaround was to > write the contents out to /tmp. That doesn't work when I'm not on the > same machine as the Java server. > I could uuencode the contents and pas them over, but then I > would have to write more Java code than I want to. All I really want to > do is: > > my $bis = $java->create_object("java.io.ByteArrayInputStream", > $entry->contents); > my $str = $java->create_object("java.io.ObjectInputStream", > $bis)->readObject->toString(); > > > Matt > > > Matt Greenwood > Two Sigma Investments, LLC > 379 W. Broadway, 5th Floor > New York, NY 10012 > > (P)212-625-5764 > (F)212-625-5864 > (M)908-380-1673 > > > -----Original Message----- > > From: ma...@zz... [mailto:ma...@zz...] > > Sent: Friday, June 11, 2004 3:46 PM > > To: Matt Greenwood > > Cc: jav...@li... > > Subject: Re: [Javaserver-java] javaserver with binary data > > > > > > > > I have never tried passing binary data but I am sure the > protocol > > > > would > > > > get in the way - you could uuencode the data & then send that over > - & > > > > just > > > > have the Java stuff uudecode it & be back in business. > > > > > > Yes, but I just want to do an object decode. > > > > > > > I don't know what you mean here. You want de-serialize java objects > > right? > > Why not just have the Java side do it? > > Mark > |