Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

newbie with RMIIO

 
Yair Ogen
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Nitesh Kant
Bartender
Posts: 1638
IntelliJ IDE Java MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Yair Ogen
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1638
IntelliJ IDE Java MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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).
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic