• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

newbie with RMIIO

 
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Bartender
Posts: 1638
IntelliJ IDE MySQL Database Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 MySQL Database Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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).
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic