import java.io.*; import javax.microedition.rms.*; /* Автор: Writer */ public class MyRMS { static myRMS mrms; static String DBNAME = "MyRMS"; static String s = "0x0F"; static String s1 = ""; static byte[] record; RecordStore RS = null; ByteArrayOutputStream baos = new ByteArrayOutputStream(); DataOutputStream dos = new DataOutputStream(baos); ByteArrayInputStream bais = new ByteArrayInputStream(record); DataInputStream dis = new DataInputStream(bais); public MyRMS() { mrms = this; } static void input() { try { RS = RecordStore.openRecordStore(DBNAME,true); dos.writeUTF(s); record = baos.toByteArray(); RS.addRecord(record, 0, record.length); RS.closeRecordStore(); }catch(Exception ex){} try { RecordStore RS = RecordStore.openRecordStore(DBNAME,false); record = RS.getRecord(1); s1 = dis.readUTF(); RS.closeRecordStore(); }catch(Exception ex){} } }