File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Can we store Objects other than String in RMS

 
Harish Tiruvile
Ranch Hand
Posts: 99
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,


While reading J2me Record Management System i found examples only on primitive data types and String Objects ..

For writing int we used writeInt(bytearray[]) method,
For String Objects we used WriteUTF(bytearray[]) method

My question is::
I have developed one class called Animal , i want to know whether i can write Animal Object in to RMS using WriteUTF(bytearray[]) method...
I mean can we use WriteUTF(bytearray[]) method to write any Objects in to RMS...

if it is not possible then how can i write Objects other than String into RMS.......I am not getting answer in books and website since all are concentrating on primitive types and String ...
[ April 18, 2006: Message edited by: harish thrivile ]
 
Ramender Mall
Ranch Hand
Posts: 311
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You seem to refer to something like ObjectOutputStream in J2SE. BUT, i think there is no support for such a thing in J2ME.

The way around is, we can store the values of the members of the class and later retrieve them. Say if a class has 2 string and 1 int member, store these values in RMS and then when needed retrieve these values and assign them back to those members.

Agreed, that structures of classes are much more complex, but there is always a way around.

More Details on Object serialization --> LOOK HERE...

- Ramy..
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic