This week's book giveaway is in the Kotlin forum.
We're giving away four copies of Kotlin in Action and have Dmitry Jemerov & Svetlana Isakova on-line!
See this thread for details.
Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Serialization with RMI  RSS feed

 
Chris Robinson
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I need to send an object between a client and server using RMI. As far as I understand I need to implement the Serializable interface in the class that I want to send objects of in order to send them as a byte stream.
Can I then just pass the object in a method call as normal and let the RMI do the work required at both ends or do I have to carry out some form of manual Serialization at the sender and Deserialization at the receiver?
 
Joe Ess
Bartender
Posts: 9428
12
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you use RMI, you simply invoke the remote method with an instance of your Serializable object. That's the beauty of it. Check out the Java Tutorial: RMI for examples.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!