亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? recordstore.java

?? 有關j2me的很好的例子可以研究一下
?? JAVA
?? 第 1 頁 / 共 5 頁
字號:
	     * for space and create it.	     */	    int space = RecordStoreFile.spaceAvailable();	    if (space - DB_INIT.length < 0) { 		throw new RecordStoreFullException();	    }	    db = new RecordStore(recordStoreName, createIfNecessary);	    	    /*	     * Now add the new record store to the cache	     */	    db.opencount = 1;	    dbCache.addElement(db);	    return db;	}    }    /**     * Returns an array of the names of record stores owned by the      * MIDlet suite. Note that if the MIDlet suite does not      * have any record stores, this function will return NULL.      *     * The order of RecordStore names returned is implementation     * dependent.     *     * @return an array of the names of record stores owned by the      *         MIDlet suite. Note that if the MIDlet suite does not      *         have any record stores, this function will return NULL.      */     public static String[] listRecordStores()     {        // static calls synchronize on dbCacheLock        synchronized (dbCacheLock) {	  String[] returnstrings = RecordStoreFile.listRecordStores();	  return returnstrings;	}    }    /**     * Deletes the named record store. MIDlet suites are only allowed to      * operate on their own record stores, including deletions. If the      * record store is currently open by a MIDlet when this method      * is called, or if the named record store does not exist, a      * RecordStoreException will be thrown.      *      * @param recordStoreName the MIDlet suite unique record store to delete.      *      * @exception RecordStoreException if a record store-related exception      *            occurred.      * @exception RecordStoreNotFoundException if the record store could      *            not be found.      */     public static void deleteRecordStore(String recordStoreName)         throws RecordStoreException, RecordStoreNotFoundException     {        // Check the record store cache for a db with the same name	synchronized (dbCacheLock) {	    RecordStore db;	    for (int n = 0; n < dbCache.size(); n++) {		db = (RecordStore)dbCache.elementAt(n);		if (db.recordStoreName.equals(recordStoreName)) {		    // cannot delete an open record store		    throw new RecordStoreException("deleteRecordStore error:"						   + " record store is"						   + " still open");		}	    }	    // this record store is not currently open	    if (RecordStoreFile.exists(recordStoreName)) {	        boolean success = RecordStoreFile.deleteFile(recordStoreName);		if (!success) {		    throw new RecordStoreException("deleteRecordStore " +						   "failed");		}	    } else {	        throw new RecordStoreNotFoundException("deleteRecordStore " +						       "error: file " +						       "not found"); 	    }	}    }    /*     * Public RecordStore update operations     */    /**     * Adds a new record to the record store. The recordId for this      * new record is returned. This is a blocking atomic operation.      * The record is written to persistent storage before the      * method returns.     *      * @param data the data to be stored in this record. If the record      *        is to have zero-length data (no data), this parameter      *        may be null.     * @param offset the index into the data buffer of the first relevant      *        byte for this record.      * @param numBytes the number of bytes of the data buffer to use for      *        this record (may be zero).     *      * @return the recordId for the new record.      *      * @exception RecordStoreNotOpenException if the record store is not open.      * @exception RecordStoreException if a different record store-related      *            exception occurred.      * @exception RecordStoreFullException if the operation cannot be      *            completed because the record store has no more room.      * @exception NullPointerException if <code>data</code> is null but     *            <code>numBytes</code> is greater than zero.     */    public int addRecord(byte[] data, int offset, int numBytes)         throws RecordStoreNotOpenException, RecordStoreException, 	RecordStoreFullException    {	synchronized (rsLock) {	    checkOpen();	    if ((data == null) && (numBytes > 0)) {		throw new NullPointerException("illegal arguments: null " +					       "data,  numBytes > 0");	    }	    // get recordId for new record, update db's dbNextRecordID	    int id = dbNextRecordID++;	    /*	     * Find the offset where this record should be stored and	     * seek to that location in the file. allocateNewRecordStorage()	     * allocates the space for this record.	     */	    	    RecordHeader rh = allocateNewRecordStorage(id, numBytes);	    try {		if (data != null) {		    rh.write(data, offset);		}	    } catch (java.io.IOException ioe) {		throw new RecordStoreException("error writing new record " 					       + "data");	    }	    	    // Update the state changes to the db file.	    dbNumLiveRecords++;	    dbVersion++;	    storeDBState();	    	    // tell listeners a record has been added	    notifyRecordAddedListeners(id);	    	    // Return the new record id	    return id;	}    }        /**     * The record is deleted from the record store. The recordId for this      * record is NOT reused.      *      * @param recordId the ID of the record to delete.      *      * @exception RecordStoreNotOpenException if the record store is not open.      * @exception InvalidRecordIDException if the recordId is invalid.      * @exception RecordStoreException if a general record store exception     *            occurs.      */     public void deleteRecord(int recordId) 	throws RecordStoreNotOpenException, InvalidRecordIDException, 	    RecordStoreException     {	synchronized (rsLock) {	    checkOpen();	    RecordHeader rh = null; // record header	    	    try {		rh = findRecord(recordId, false);		freeRecord(rh); // calls rh.store				recHeadCache.invalidate(rh.id);	    } catch (java.io.IOException ioe) {		throw new RecordStoreException("error updating file after" + 					       " record deletion");	    }	    	    // update database header info and sync to file	    dbNumLiveRecords--;	    dbVersion++;	    storeDBState();	    // tell listeners a record has been deleted	    notifyRecordDeletedListeners(recordId);	}    }    /**     * This method is called when the MIDlet requests to have the     * record store closed. Note that the record store will not     * actually be closed until closeRecordStore() is called as many     * times as openRecordStore() was called. In other words, the     * MIDlet needs to make a balanced number of close calls as open     * calls before the record store is closed.<p>     *     * When the record store is closed, all listeners are removed.     * If the MIDlet attempts to perform operations on the      * RecordStore object after it has been closed, the methods will      * throw a RecordStoreNotOpenException.      *      * @exception RecordStoreNotOpenException if the record store is not open.      * @exception RecordStoreException if a different record store-related      *            exception occurred.      */     public void closeRecordStore()	throws RecordStoreNotOpenException, RecordStoreException     {	synchronized (rsLock) {	    synchronized (dbCacheLock) {		checkOpen();		/*		 * Find the record store within the record store cache.		 * A linear search is OK assuming there won't be many 		 * concurrently open record stores.		 */		RecordStore db = null;		for (int n = 0; n < dbCache.size(); n++) {		    db = (RecordStore)dbCache.elementAt(n);		    if (db == this) {			db.opencount--;			break;		    }		}		if (db.opencount <= 0) {  // free stuff - final close		    dbCache.removeElement(db);		    try {			// closing now...no need to listen			if (!recordListener.isEmpty()) {			    recordListener.removeAllElements();			}						// close native fd 			if (dbFirstFreeBlockOffset != 0) {			    compactRecords();  // compact before close			    // truncate file to compacted size			    dbraf.truncate(dbDataEnd);			} 			dbraf.close();		    } catch (java.io.IOException ioe) {			throw new RecordStoreException("error closing .db " +						       "file");		    } finally {			dbraf = null;			recHeadCache = null;		    }		}	    }	}    }    /**     * Returns the size (in bytes) of the MIDlet data available     * in the given record.     *      * @param recordId the id of the record to use in this operation.      *      * @return the size (in bytes) of the MIDlet data available     *         in the given record.     *      * @exception RecordStoreNotOpenException if the record store is not open.      * @exception InvalidRecordIDException if the recordId is invalid.      * @exception RecordStoreException if a general record store exception      *            occurs.      */     public int getRecordSize(int recordId) 	throws RecordStoreNotOpenException, InvalidRecordIDException, 	    RecordStoreException     {	synchronized (rsLock) {	    checkOpen();	    try {		// throws InvalidRecordIDException		RecordHeader rh = findRecord(recordId, true);		return (rh.dataLenOrNextFree);	    } catch (java.io.IOException ioe) {	        throw new RecordStoreException("error reading record data");	    }	}    }        /**     * Returns the data stored in the given record.      *      * @param recordId the id of the record to use in this operation.      * @param buffer the byte array in which to copy the data.      * @param offset the index into the buffer in which to start copying.      *      * @exception RecordStoreNotOpenException if the record store is not open.      * @exception InvalidRecordIDException if the recordId is invalid.      * @exception RecordStoreException if a general record store exception      *            occurs.      * @return the number of bytes copied into the buffer, starting at      *         index <code>offset</code>.      *     * @see #setRecord     */     public int getRecord(int recordId, byte[] buffer, int offset) 	throws RecordStoreNotOpenException, InvalidRecordIDException, 	RecordStoreException    {	synchronized (rsLock) {	    checkOpen();	    	    RecordHeader rh;	    try {		// throws InvalidRecordIDException		rh = findRecord(recordId, true);		rh.read(buffer, offset);	    } catch (java.io.IOException ioe) {		throw new RecordStoreException("error reading record data");	    }	    return rh.dataLenOrNextFree;	}    }        /**     * Returns a copy of the data stored in the given record.      *      * @param recordId the id of the record to use in this operation.      *      * @exception RecordStoreNotOpenException if the record store is not open.      * @exception InvalidRecordIDException if the recordId is invalid.      * @exception RecordStoreException if a general record store exception      *            occurs.      *      * @return the data stored in the given record. Note that if the record      *         has no data, this method will return null.     *     * @see #setRecord     */     public byte[] getRecord(int recordId) 	throws RecordStoreNotOpenException, InvalidRecordIDException, 	    RecordStoreException     {	synchronized (rsLock) {	    checkOpen();	    int size = 0;	    byte[] data = null;	    try {		// throws InvalidRecordIDException		RecordHeader rh = findRecord(recordId, true); 		if (rh.dataLenOrNextFree == 0) {		    return null;		}		data = new byte[rh.dataLenOrNextFree];		rh.read(data, 0);	    } catch (java.io.IOException ioe) {		throw new RecordStoreException("error reading record data");	    } 	    return data;	}    }    /**     * Sets the data in the given record to that passed in. After     * this method returns, a call to <code>getRecord(int recordId)</code>     * will return an array of numBytes size containing the data supplied here.     *      * @param recordId the id of the record to use in this operation.      * @param newData the new data to store in the record.      * @param offset the index into the data buffer of the first relevant      *        byte for this record.      * @param numBytes the number of bytes of the data buffer to use for      *        this record.      *      * @exception RecordStoreNotOpenException if the record store is not open.      * @exception InvalidRecordIDException if the recordId is invalid.      * @exception RecordStoreException if a general record store exception      *            occurs.      * @exception RecordStoreFullException if the operation cannot be      *            completed because the record store has no more room.      *     * @see #getRecord     */     public void setRecord(int recordId, byte[] newData, 			  int offset, int numBytes) 	throws RecordStoreNotOpenException, InvalidRecordIDException, 	    RecordStoreException, RecordStoreFullException     {	synchronized (rsLock) {	    checkOpen();	    	    if ((newData == null) && (numBytes > 0)) {		throw new NullPointerException();	    }	    	    RecordHeader rh = null;

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
依依成人综合视频| 天堂va蜜桃一区二区三区 | 国产综合色在线视频区| 久久精品亚洲精品国产欧美| 91国内精品野花午夜精品 | 97精品国产露脸对白| 日韩国产精品久久| 日韩美女视频19| 国产无人区一区二区三区| 7777精品伊人久久久大香线蕉的 | 蜜臀精品久久久久久蜜臀 | 91精品国产色综合久久久蜜香臀| 国产激情一区二区三区桃花岛亚洲| 一区二区三区中文字幕在线观看| 久久综合五月天婷婷伊人| 欧美日本一道本| 日本福利一区二区| 99久久99久久综合| 专区另类欧美日韩| 91精品国产综合久久香蕉麻豆| 成人免费视频免费观看| 精品不卡在线视频| 99久久国产综合色|国产精品| 亚洲国产精品传媒在线观看| 91麻豆免费看片| 日本sm残虐另类| 久久理论电影网| 成人精品国产一区二区4080| 亚洲成人先锋电影| 欧美一卡2卡三卡4卡5免费| 国产成都精品91一区二区三| 精油按摩中文字幕久久| 日本女人一区二区三区| 性做久久久久久免费观看| 亚洲图片有声小说| 亚洲6080在线| 免费人成精品欧美精品| 日韩av高清在线观看| 日本欧美一区二区在线观看| 天天综合色天天综合| 天天综合色天天| 开心九九激情九九欧美日韩精美视频电影| 午夜精品免费在线观看| 天堂va蜜桃一区二区三区漫画版| 亚洲h在线观看| 日日摸夜夜添夜夜添亚洲女人| 亚洲国产一区二区三区青草影视| 亚洲国产成人精品视频| 天堂成人国产精品一区| 久久精品国产第一区二区三区| 久久99国产精品久久99果冻传媒| 国内精品在线播放| 国产成人av福利| 99久久国产综合精品麻豆| 色94色欧美sute亚洲线路一久 | 午夜a成v人精品| 日本不卡视频在线观看| 国产毛片一区二区| 成人性生交大合| 91视频xxxx| 欧美一区日韩一区| 国产视频911| 中文字幕一区二区在线播放| 一级中文字幕一区二区| 美女免费视频一区| 成人精品国产福利| 欧美日韩视频不卡| 精品国精品国产| 成人免费小视频| 日韩成人免费在线| 高清不卡在线观看av| 在线视频欧美区| 精品国产免费一区二区三区香蕉| 欧美高清一级片在线观看| 一区二区三区在线不卡| 久久精品国产77777蜜臀| 国产三级欧美三级日产三级99| 日韩毛片高清在线播放| 成人性色生活片| 欧美在线一区二区三区| 欧美一区二区美女| 中文在线免费一区三区高中清不卡| 中文字幕一区二区三区在线不卡 | 91美女在线视频| 欧美日韩一级片在线观看| 国产精品久久久久一区二区三区| 麻豆国产欧美日韩综合精品二区| 国产精品小仙女| 欧美日韩国产中文| 中文字幕av一区二区三区免费看 | 一区二区三区国产| 九九热在线视频观看这里只有精品| www.亚洲色图| 日韩精品专区在线影院观看| 亚洲欧美一区二区不卡| 在线观看欧美黄色| 中文字幕av一区二区三区免费看| 五月天国产精品| 色婷婷久久久久swag精品| 26uuuu精品一区二区| 亚洲午夜精品网| 成人久久久精品乱码一区二区三区| 7777精品伊人久久久大香线蕉经典版下载 | 国产一区二区三区免费看| 欧美日韩亚洲综合| 中文字幕在线一区二区三区| 国产一区二三区| 欧美精品国产精品| 亚洲乱码精品一二三四区日韩在线| 国产在线看一区| 日韩一区二区在线看片| 亚洲尤物在线视频观看| 国产成人高清在线| 精品久久久久久久人人人人传媒 | 日韩理论片在线| 国产传媒久久文化传媒| 日韩精品一区二| 青青草国产精品97视觉盛宴| 欧美日韩国产在线观看| 亚洲一区二区三区四区在线观看| 99久久久精品免费观看国产蜜| 久久久久久久久岛国免费| 久久99热99| 欧美不卡视频一区| 免费成人美女在线观看| 3d动漫精品啪啪1区2区免费 | 日韩高清在线观看| 欧美日韩国产高清一区二区三区| 一区二区三区成人| 色欧美88888久久久久久影院| 国产精品久久久久久久久果冻传媒 | 亚洲免费观看高清完整版在线观看熊 | 欧美疯狂性受xxxxx喷水图片| 国产精品麻豆网站| 欧美福利电影网| 91免费观看视频| 久久久久久久久免费| 亚洲成人av资源| 911国产精品| 日本不卡中文字幕| 日韩一卡二卡三卡四卡| 另类小说图片综合网| 欧美成人午夜电影| 韩国成人精品a∨在线观看| 久久久五月婷婷| 成人高清视频免费观看| 亚洲免费在线视频一区 二区| 91成人免费在线| 图片区小说区国产精品视频| 91精品国产品国语在线不卡| 久久99久久久欧美国产| 国产欧美日本一区视频| 97aⅴ精品视频一二三区| 亚洲一区二区综合| 91精品国产黑色紧身裤美女| 激情综合色综合久久综合| 国产网站一区二区| 91在线观看美女| 香蕉加勒比综合久久| 精品国产一区二区国模嫣然| 国产91丝袜在线18| 亚洲一二三专区| 精品国产第一区二区三区观看体验 | 日韩欧美一区电影| 岛国精品在线观看| 亚洲一区电影777| 亚洲精品一区二区三区影院 | 97久久精品人人澡人人爽| 亚洲午夜视频在线观看| 欧美成人精品1314www| 成人精品小蝌蚪| 午夜精品一区二区三区免费视频 | 日本道精品一区二区三区| 日韩激情在线观看| 久久精品欧美日韩| 欧美性受xxxx| 国产精品中文字幕一区二区三区| 亚洲精品免费在线| 久久综合狠狠综合久久激情 | 久久精工是国产品牌吗| |精品福利一区二区三区| 日韩视频一区二区在线观看| 成人黄色综合网站| 日本一道高清亚洲日美韩| 国产精品白丝在线| 精品日韩成人av| 欧美日韩一二区| 中文字幕亚洲区| 亚洲成a人片在线不卡一二三区| 国产a精品视频| 午夜精品久久久久久久| jlzzjlzz亚洲女人18| 欧美日韩日日夜夜| 久久久久久夜精品精品免费| 中文字幕综合网| 黄色精品一二区| 欧美日韩国产中文| 国产精品久久毛片| 日韩**一区毛片| 91视频一区二区|