• Post Reply Bookmark Topic Watch Topic
  • New Topic

How can I transfer Image between client and server side in RMI  RSS feed

 
Jack Deng
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
please show me same smaple code
 
Lasse Koskela
author
Sheriff
Posts: 11962
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Assuming that you're talking about java.awt.Image (which doesn't implement Serializable, I believe), you could consider writing the image into a byte array, send the byte array to the RMI stub, and have the server-side object read the raw bytes back into an Image object.

For example, you could do something like

[ July 25, 2004: Message edited by: Lasse Koskela ]
 
omar bili
Ranch Hand
Posts: 177
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi all ,i need to send a ResultSet
using a socket, ResultSet are not serializable
how can i do it ?
thx for any help
 
Nathan Pruett
Bartender
Posts: 4121
IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Pull the data out of the ResultSet and put it into a serializable Collection class (HashMap, ArrayList, etc.) and send the Collection instead.

P.S. - By the way, it's better to start a new topic when you have a new question, rather than tack it onto an existing topic that is only marginally related.
[ August 18, 2004: Message edited by: Nathan Pruett ]
 
Bruce Lee
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Many thanks to Koskela, the code/advice is really helpful to me!
[ September 14, 2004: Message edited by: Bruce Lee ]
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!