mmsconfigurator.java

来自「用Java写的彩信的程序。包括wsp/mime/mms几部分。」· Java 代码 · 共 44 行

JAVA
44
字号
/* 
 * JVending - J2ME MMS Client
 *
 * Distributed under Apache style software license included with the source code.
 */

package org.jvending.mmsclient;

import javax.microedition.rms.RecordStore;
import javax.microedition.rms.RecordStoreException;
import javax.microedition.rms.RecordStoreFullException;
import javax.microedition.rms.RecordStoreNotFoundException;

/**
 * stores configuration information in the RMS
 * @author Shane Isbell
 * @version 1.0.0a
 * @created 04/03/27
 */

public class MmsConfigurator {

    private RecordStore recordStore;

    private final int MMSC_ADDRESS = 0;

    private String mmscAddress;

    public void config() throws Exception {
        recordStore = RecordStore.openRecordStore("mmsconfig", true);
        mmscAddress = new String(recordStore.getRecord(MMSC_ADDRESS));      
    } 

    public void setAddress(String address) throws Exception {
        byte[] b = address.getBytes();
        recordStore.setRecord(MMSC_ADDRESS, b, 0, b.length);
        this.mmscAddress = address;
    }

    public String getAddress() {
        return mmscAddress;
    }

}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?