aspose file tools*
The moose likes Distributed Java and the fly likes newbie with RMIIO Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Distributed Java
Bookmark "newbie with RMIIO" Watch "newbie with RMIIO" New topic
Author

newbie with RMIIO

Yair Ogen
Greenhorn

Joined: Feb 12, 2003
Posts: 29
Hi,

can anyone share how you used rmiio?

for example, if I build:

RemoteIteratorServer<DummyData> dummyDataRemoteIteratorServer = new RemoteIteratorServer<DummyData>(new SimpleRemoteInputStream(inputStream));

what should "inputStream" be?

my goal is for the server to send data to the client in a "chunk" fashion.

can you help?

thanks,

Yair


Regards,<br /> <br />Yair Ogen
Nitesh Kant
Bartender

Joined: Feb 25, 2007
Posts: 1638

Yair Ogen wrote:
what should "inputStream" be?


Its a stream over the data that you want to send. If you want to send a file, it will be the stream over that file.


apigee, a better way to API!
Yair Ogen
Greenhorn

Joined: Feb 12, 2003
Posts: 29
My use case is as follows:

Client sends request to retrieve data. Server has a large amount of data (> 2GB), hence we want data (List of objects) to be sent as chunks of objects (e.g. one object at a time).

So the inputStream will be an ObjetInputStream? still that needs to wrap another input stream. BytearrayInputStream?

Has anyone done anything similar using rmiio?

Yair
Nitesh Kant
Bartender

Joined: Feb 25, 2007
Posts: 1638

I am not sure why would you want to wrap the ObjectInputStream with a ByteArrayInputStream.
RMIIO with chunk your stream in default or specified chunk sizes and the reader (also RMIIO) will also read in similar chunks.
I am also not so sure whether you can chunk it based on the number of objects in each chunk but in my opinion, it should not matter.
I would recommend you to try out the examples in RMIIO to understand how it works. Sending a normal file or a stream of objects using RMIIO is not different.
james ahlborn
Greenhorn

Joined: Oct 31, 2008
Posts: 2
the reason you are confused is that you generally do not use the RemoteIteratorServer class directly. if, for instance, you had serializable objects, you would use the SerialRemoteIteratorServer with an iterator which returns some serializable objects. see the example iterator TestClient (possibly somewhat confusingly named).
 
Consider Paul's rocket mass heater.
 
subject: newbie with RMIIO