This post originated from an RSS feed registered with Ruby Buzz
by Obie Fernandez.
Original Post: Deserialize Java Objects Into Ruby
Feed Title: Obie On Rails (Has It Been 9 Years Already?)
Feed URL: http://jroller.com/obie/feed/entries/rss
Feed Description: Obie Fernandez talks about life as a technologist, mostly as ramblings about software development and consulting. Nowadays it's pretty much all about Ruby and Ruby on Rails.
Java object stream is a pure Ruby implementation of Java serialization. This module decodes the Java stream and creates dynamic Ruby objects based on the meta information contained in the serialized stream. Contains similar methods to the Java serialization package to implement Externalizable objects.
Both reading and writing of serialization streams are supported. To write an object a sample object must be read to initialize the UUID associated with the class or the UUID must be supplied to the Java meta class.
A similar module was used to test a Java RPC infrastructure that sent objects over a socket using serialization. Ruby proved to be a much more dynamic test harness than the Java counterpart.