1

I need to store large amount of data using RMS API through J2ME.

How can I store that multiple-column data, given they must be hardcoded so I need to store those multiple columns and rows data.

How can I do this in this, should I use structs?

gnat
  • 6,213
  • 108
  • 53
  • 73

3 Answers3

2

Well, RMS only allows you to store records that are arrays of bytes. You will have to decide for yourself how a record is stored, and if you want to store your data in a single or in multiple records. If you use the DataInputStream and DataOutputStream classes, you'll be able to read/write Strings, booleans, integers, etc. The API documentation includes a decent example of how you can do this.

If you have complex data to store, or a lot of different objects, you may want to create a simple library for RMS I/O, that allows you to pass objects implementing e.g. "Storable" to a library class that writes away your object into RMS.

Jeroen Heijmans
  • 4,546
  • 2
  • 17
  • 16
2

See my question on exacty the same topic. In the end we bought a commercial BTree imeplementation and extended it to work across multiple record stores.

Community
  • 1
  • 1
roryf
  • 29,592
  • 16
  • 81
  • 103
1

Has Jeroen said RMS is quite basic. You can only store arrays of bytes. But, though it's basic, it's quite easy implement a more complex memory structure with an index stored in a record store and addressing other record stores containing data.

Have a look to this page : Understanding the Record Management System