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

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

?? recordstore.java

?? 有關j2me的很好的例子可以研究一下
?? JAVA
?? 第 1 頁 / 共 5 頁
字號:
	    RecordHeader newrh = null;	    	    try {		rh = findRecord(recordId, false); // throws InvalidRIDException	    } catch (java.io.IOException ioe) {		throw new RecordStoreException("error finding record data");	    }	    /*	     * The size of the data and space allocated to the	     * current record is known here, as is the new size.	     * Determine if the new data will fit, or if this 	     * record will have to be stored elsewhere.	     */	    if (numBytes <= rh.blockSize - DB_RECORD_HEADER_LENGTH) {		/*		 * The new data should fit within the existing record		 * location in the file. Store the new data and		 * patch up the record's header fields.		 */		int allocSize = getAllocSize(numBytes);		if (rh.blockSize - allocSize >= 		    DB_BLOCK_SIZE + DB_RECORD_HEADER_LENGTH) {		    splitRecord(rh, allocSize); // sets rh.blockSize	        }		rh.dataLenOrNextFree = numBytes;				try {		    rh.store(); // write the new record header		    recHeadCache.insert(rh);  // add to cache				    if (newData != null) {			rh.write(newData, offset);		    }		} catch (java.io.IOException ioe) {		    throw new RecordStoreException("error writing record" +						   " data");		}	    } else {		/*		 * The new data is longer than the old data.  It needs to		 * be relocated to elsewhere within <code>dbfile</code>. 		 * Search the free list to see if there's a space where to		 * store it.  Otherwise append it to the end of the file.		 */		freeRecord(rh); // calls rh.store()		newrh = allocateNewRecordStorage(recordId, numBytes);		try {		    if (newData != null) {			newrh.write(newData, offset);			// NOTE: I/O exception leaves space allocated & unused		    }		} catch (java.io.IOException ioe) {		    throw new RecordStoreException("error moving record " +						   "data");		}	    }	    	    // update database header info and sync to file	    dbVersion++;	    storeDBState();	    notifyRecordChangedListeners(recordId);	}    }    /*     * Public RecordStore accessor methods     */    /**     * Returns the name of this RecordStore. Not synchronized as     * the name is immutable.     *      * @return the name of this RecordStore.      *      * @exception RecordStoreNotOpenException if the record store is closed      */     public String getName() 	throws RecordStoreNotOpenException     {	checkOpen();	return recordStoreName;    }    /**     * Each time a record store is modified (record added, modified, deleted),      * it's <em>version</em> is incremented. This can be used by MIDlets to      * quickly tell if anything has been modified.      *     * The initial version number is implementation dependent.     * The increment is a positive integer greater than 0.     * The version number only increases as the RecordStore is updated.     *     * @return the current record store version.      *      * @exception RecordStoreNotOpenException if the record store is not open.      */     public int getVersion() 	throws RecordStoreNotOpenException     {	checkOpen();	return dbVersion;    }    /**     * Returns the number of records currently in the record store.      *     * @return the number of records currently in the record store.      *      * @exception RecordStoreNotOpenException if the record store is not open.      */     public int getNumRecords() 	throws RecordStoreNotOpenException     {	checkOpen();	return dbNumLiveRecords;    }        /**     * Returns the amount of space, in bytes, that the record store     * occupies. The size returned includes any overhead associated     * with the implementation, such as the data structures     * used to hold the state of the record store, etc.     *     * @exception RecordStoreNotOpenException if the record store is      *            not open.      *      * @return the size of the record store in bytes.     */     public int getSize() 	throws RecordStoreNotOpenException     {	checkOpen();	// return the file size of the record store file	return dbDataEnd;    }    /**     * Returns the amount of additional room (in bytes) available for      * this record store to grow. Note that this is not necessarily     * the amount of extra MIDlet-level data which can be stored,     * as implementations may store additional data structures with     * each record to support integration with native applications,     * synchronization, etc.     *      * @exception RecordStoreNotOpenException if the record store is not open.      *      * @return the amount of additional room (in bytes) available for      *         this record store to grow.      */     public int getSizeAvailable() 	throws RecordStoreNotOpenException     {	checkOpen();	int rv = RecordStoreFile.spaceAvailable() - 	    DB_BLOCK_SIZE - DB_RECORD_HEADER_LENGTH;	return (rv < 0) ? 0 : rv;    }        /**     * Returns the last time the record store was modified, in the format      * used by System.currentTimeMillis().      *      * @return the last time the record store was modified, in the format      *         used by <code>System.currentTimeMillis()</code>.      *      * @exception RecordStoreNotOpenException if the record store is not open.      */     public long getLastModified() 	throws RecordStoreNotOpenException     {	checkOpen();	return dbLastModified;    }    /**     * Adds the specified RecordListener. If the specified listener      * is already registered, it will not be added a second time.      * When a record store is closed, all listeners are removed.      *      * @param listener the RecordChangedListener to add.      *     * @see #removeRecordListener     */     public void addRecordListener(RecordListener listener)     {	synchronized (rsLock) {	    if (!recordListener.contains(listener))		recordListener.addElement(listener);	}    }    /**     * Removes the specified RecordListener. If the specified listener      * is not registered, this method does nothing.      *      * @param listener the RecordChangedListener to remove.      *     * @see #addRecordListener     */     public void removeRecordListener(RecordListener listener)     {	synchronized (rsLock) {	    recordListener.removeElement(listener);	}    }        /**     * Returns the recordId of the next record to be added to the      * record store. This can be useful for setting up pseudo-relational      * relationships. That is, if you have two or more      * record stores whose records need to refer to one another, you can      * predetermine the recordIds of the records that will be created      * in one record store, before populating the fields and allocating      * the record in another record store. Note that the recordId returned      * is only valid while the record store remains open and until a call      * to <code>addRecord()</code>.       *      * @return the record id of the next record to be added to the      *         record store.      *      * @exception RecordStoreNotOpenException if the record store is not open.      * @exception RecordStoreException if a different record store-related      *            exception occurred.      */     public int getNextRecordID() 	throws RecordStoreNotOpenException, RecordStoreException     {	checkOpen();	return dbNextRecordID;    }        /**     * Returns an enumeration for traversing a set of records in the      * record store in an optionally specified order.<p>      *      * The filter, if non-null, will be used to determine what      * subset of the record store records will be used.<p>      *      * The comparator, if non-null, will be used to determine the      * order in which the records are returned.<p>      *      * If both the filter and comparator are null, the enumeration      * will traverse all records in the record store in an undefined      * order. This is the most efficient way to traverse all of the      * records in a record store.<p>     *      * The first call to <code>RecordEnumeration.nextRecord()</code>      * returns the record data from the first record in the sequence.     * Subsequent calls to <code>RecordEnumeration.nextRecord()</code>     * return the next consecutive record's data. To return the record     * data from the previous consecutive from any      * given point in the enumeration, call <code>previousRecord()</code>.      * On the other hand, if after creation the first call is to      * <code>previousRecord()</code>, the record data of the last element     * of the enumeration will be returned. Each subsequent call to      * <code>previousRecord()</code> will step backwards through the     * sequence.      *     * @param filter if non-null, will be used to determine what      *        subset of the record store records will be used.      * @param comparator if non-null, will be used to determine the      *        order in which the records are returned.      * @param keepUpdated if true, the enumerator will keep its enumeration      *        current with any changes in the records of the record store.      *        Use with caution as there are possible performance      *        consequences. If false the enumeration will not be kept      *        current and may return recordIds for records that have been     *        deleted or miss records that are added later. It may also      *        return records out of order that have been  modified after the     *        enumeration was built. Note that any changes to records in the     *        record store are accurately reflected when the record is later     *        retrieved, either directly or through the enumeration. The      *        thing that is risked by setting this parameter false is the      *        filtering and sorting order of the enumeration when records      *        are modified, added, or deleted.     *      * @exception RecordStoreNotOpenException if the record store is not open.      *     * @see RecordEnumeration#rebuild     *      * @return an enumeration for traversing a set of records in the      *         record store in an optionally specified order.     */     public RecordEnumeration enumerateRecords(RecordFilter filter, 					      RecordComparator comparator, 					      boolean keepUpdated) 	throws RecordStoreNotOpenException     {	checkOpen();	return new RecordEnumerationImpl(this, filter, 					 comparator, keepUpdated);    }    /*     * Private Memory Management Methods     */    /**     * Find the record header for a record <code>recordId</code>.     *     * @param recordId the id of the desired record header.     * @param addToCache true if this record should be added to cache      *        if found.     *     * @return the record header for the given record, or null if      *         the record cannot be found.     */    private RecordHeader findRecord(int recordId, boolean addToCache)	throws InvalidRecordIDException, java.io.IOException    {	RecordHeader rh;	int offset;		int cur_offset = dbFirstRecordOffset;	// if no records exist, throw an exception	if (cur_offset == 0) {	    throw new InvalidRecordIDException();	}		// look for the record in the cache	rh = recHeadCache.get(recordId);	if (rh != null) {	    return rh;	}		/*	 * requested record header is NOT in cache...	 * search through the linked list of records	 * in the file. 	 */	rh = new RecordHeader();		while (cur_offset != 0) {	    rh.load(cur_offset);	    if (rh.id == recordId) {		break;	    } else {		cur_offset = rh.nextOffset;	    }	} 		if (cur_offset == 0) { 	    // hit the end of the linked list w/o finding record.	    throw new InvalidRecordIDException();	}		if (addToCache)	    recHeadCache.insert(rh);	return rh;    }        /**     * Return the block allocation size for a record with <code>numBytes     * </code> data bytes.  This includes space for the record header     * and is a multiple of <code>DB_BLOCK_SIZE</code>.     *     * @param numBytes number of data bytes that will be stored in record     *     * @return the amount of space to allocate for this record.     */    private int getAllocSize(int numBytes) {	int rv;	int pad;	rv = DB_RECORD_HEADER_LENGTH + numBytes;	pad = DB_BLOCK_SIZE - (rv % DB_BLOCK_SIZE);	if (pad != DB_BLOCK_SIZE)	    rv += pad;	return rv;    }    /**     * Returns a new record header for record <code>id</code> large     * enough to hold <code>dataSize</code> bytes of record data.     *     * Picks a free block using a first fit strategy that is      * large enough for a record header and the associated     * record data.  The block will be a multiple of DB_BLOCK_SIZE.     *     * @param id the record id to assign to the returned record header.     * @param dataSize length of record data that will be      *        stored with this record.

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲日本乱码在线观看| av激情亚洲男人天堂| 国产成人综合在线| 色综合一个色综合| 在线播放国产精品二区一二区四区| 日韩欧美高清在线| 中文字幕中文在线不卡住| 亚洲亚洲人成综合网络| 久久66热偷产精品| 99久久99久久精品免费观看| 色综合久久久久综合体| 91性感美女视频| 中文字幕不卡一区| 首页亚洲欧美制服丝腿| 国产·精品毛片| 久久精品亚洲麻豆av一区二区| 日本一区二区三区电影| 亚洲午夜在线视频| 国产成人精品网址| 欧美亚洲国产一区二区三区| ww久久中文字幕| 最新国产成人在线观看| 天天综合色天天综合| 国产福利精品导航| 欧美人xxxx| 亚洲色图制服诱惑 | 懂色av中文一区二区三区| 91免费版在线| 久久人人97超碰com| 五月天一区二区| 成人丝袜18视频在线观看| 91蝌蚪porny九色| 91国在线观看| 国产性色一区二区| 日韩国产成人精品| av高清久久久| 久久久国产午夜精品| 亚洲国产你懂的| 国产又粗又猛又爽又黄91精品| 91美女片黄在线观看| 日韩欧美自拍偷拍| 一区二区免费在线| 国产成人午夜精品影院观看视频| 欧美福利视频导航| 中文字幕一区二区三区不卡| 捆绑调教一区二区三区| 91在线视频免费91| 国产日韩在线不卡| 日本一区中文字幕| 99视频超级精品| 欧美r级电影在线观看| 亚洲国产精品一区二区久久| 色综合久久天天综合网| ww亚洲ww在线观看国产| 久久国产精品第一页| 欧美日韩在线一区二区| 有码一区二区三区| 成人国产亚洲欧美成人综合网 | 中文字幕一区二区日韩精品绯色| 日本欧美在线看| 色美美综合视频| 欧美激情资源网| 国内外成人在线| 日韩久久免费av| 日韩成人精品视频| 国产91丝袜在线观看| 精品伦理精品一区| 欧美一a一片一级一片| 亚洲嫩草精品久久| 中文字幕乱码日本亚洲一区二区| 狠狠色综合播放一区二区| 欧美夫妻性生活| 日本大胆欧美人术艺术动态| 精品国产乱码久久久久久闺蜜| 麻豆一区二区三区| 欧美va亚洲va在线观看蝴蝶网| 欧美午夜寂寞影院| 7777精品伊人久久久大香线蕉经典版下载| 国产精品日日摸夜夜摸av| 国产91精品久久久久久久网曝门| 日韩久久久精品| 国产在线视视频有精品| 欧美电视剧在线观看完整版| 精品在线一区二区| 在线91免费看| 亚洲国产综合91精品麻豆| 欧美揉bbbbb揉bbbbb| 亚洲最大色网站| 欧美精品亚洲二区| 午夜视频一区二区三区| 这里只有精品视频在线观看| 偷拍与自拍一区| 精品国产乱码久久久久久夜甘婷婷 | 欧美精选午夜久久久乱码6080| 一区二区三区四区在线| 99精品偷自拍| 亚洲成av人片在www色猫咪| 欧美日韩国产美女| 六月丁香婷婷色狠狠久久| 欧美一区二区三区人| 国产麻豆精品在线| 久久精品人人做| 91在线观看一区二区| 亚洲精品日韩一| 7777精品久久久大香线蕉| 日本欧美大码aⅴ在线播放| 久久嫩草精品久久久久| 国产精品一区免费在线观看| 国产精品毛片久久久久久| 99国产精品99久久久久久| 亚洲一区在线视频| 69av一区二区三区| 捆绑调教一区二区三区| 国产无遮挡一区二区三区毛片日本| 国产自产2019最新不卡| 亚洲免费在线电影| 911精品国产一区二区在线| 国产黑丝在线一区二区三区| 国产精品久久三| 欧美一区二区三区四区视频| 国产真实乱子伦精品视频| 91在线观看一区二区| 91女人视频在线观看| 成人a免费在线看| 欧美一区二区免费| 精品视频在线免费观看| 欧美色涩在线第一页| 91色婷婷久久久久合中文| 欧美xxxxxxxx| 精品奇米国产一区二区三区| 欧美欧美欧美欧美首页| 国产亚洲一区字幕| 国产精品久久久久久久久免费樱桃 | 亚洲国产成人av网| 久久久精品日韩欧美| 99精品久久免费看蜜臀剧情介绍| 日韩国产精品久久久| 日本一区二区免费在线观看视频| 欧美日韩成人综合| 国产精品99久久久久久似苏梦涵| 亚洲h在线观看| 国产亚洲精品资源在线26u| 欧美久久一区二区| 成人黄色av电影| 国产乱码精品一品二品| 亚洲综合在线观看视频| 国产欧美一区二区精品性| 欧美日韩日日骚| 成人免费毛片app| 美女一区二区在线观看| 亚洲一区在线观看免费观看电影高清| 精品少妇一区二区三区日产乱码| 欧美亚洲免费在线一区| 丁香五精品蜜臀久久久久99网站| 毛片av一区二区| 亚洲一区二区五区| 亚洲欧洲日韩一区二区三区| 精品噜噜噜噜久久久久久久久试看| 欧美性极品少妇| 成人动漫一区二区| 国产suv精品一区二区883| 日韩一区精品字幕| 亚洲午夜激情网页| 国产精品拍天天在线| 国产亚洲一本大道中文在线| 在线综合+亚洲+欧美中文字幕| 欧美在线色视频| 91在线视频在线| 94-欧美-setu| 国产精品99久久久久久久女警| 久久国产精品露脸对白| 婷婷六月综合亚洲| 亚洲成人在线观看视频| 亚洲欧美经典视频| 亚洲色大成网站www久久九九| 久久久久综合网| 久久婷婷色综合| 日韩一卡二卡三卡四卡| 日韩欧美黄色影院| 欧美久久久影院| 91精品免费在线| 欧美乱熟臀69xxxxxx| 7777精品伊人久久久大香线蕉超级流畅 | 91美女片黄在线观看91美女| 日本大胆欧美人术艺术动态| 日本乱码高清不卡字幕| 亚洲国产成人私人影院tom | 中文一区在线播放| 免费看欧美女人艹b| 欧美sm极限捆绑bd| www.欧美色图| 日本欧美久久久久免费播放网| 亚洲黄网站在线观看| 亚洲午夜在线视频| 夜夜嗨av一区二区三区中文字幕| 亚洲综合一区二区三区| 亚洲一区电影777| 奇米精品一区二区三区在线观看一| 午夜免费欧美电影| 免费国产亚洲视频|