I have a server side application to which I’m attempting to share access to via RMI. The application has an abstract representation of an “item” which is most commonly represents a file but could represent almost any arbitrary data including stream (streaming radio, streaming data from a sensor). Consequently any “item” is accessed through an InputStream (alongside a method to indicate the file size if it can be known).
While RMI is sufficient for the rest of the application, it really can’t handle InputStreams.
It strikes me that the need to access InputStreams while using RMI must be a common problem. So I was wondering:
What are the recommended solutions?
Note I need the client to both send and receive input streams and serializing to a byte array is not viable because some of them actually do represent a stream of data, not just a file.
I use RMIIO library to share streams over RMI.
See classes:
com.healthmarketscience.rmiio.RemoteInputStreamandcom.healthmarketscience.rmiio.RemoteOutputStreamSee also: Remote streaming reference with RMIIO