Retrieve a record from a record store

  1. Import the required classes and interfaces.
    import java.lang.String;
    import javax.microedition.rms.RecordStore;
  2. Invoke getRecord(int, byte[], int). Pass the following parameters:
    • a record ID
    • a byte array
    • an offset
    byte[] data = new byte[store.getRecordSize(id)];
    store.getRecord(id, data, 0);
    String dataString = new String(data);

Was this information helpful? Send us your comments.