Code sample: Adding a record to the record store

The following code sample shows you how to add a byte array using the RMS API.

int authMode = RecordStore.AUTHMODE_ANY;
boolean bWrite = true;

rs = RecordStore.openRecordStore( "rs", true, 
       authMode, bWrite );
  
byte[] pi = new byte[]{ 3, 1, 4, 1, 5, 9 };
int recordID;

recordID = rs.addRecord(pi, 0, pi.length);

Was this information helpful? Send us your comments.