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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? compoundfilewriter.java

?? lucene-2.4.0 是一個全文收索的工具包
?? JAVA
字號:
package org.apache.lucene.index;/** * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements.  See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License.  You may obtain a copy of the License at * *     http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */import org.apache.lucene.store.Directory;import org.apache.lucene.store.IndexOutput;import org.apache.lucene.store.IndexInput;import java.util.LinkedList;import java.util.HashSet;import java.util.Iterator;import java.io.IOException;/** * Combines multiple files into a single compound file. * The file format:<br> * <ul> *     <li>VInt fileCount</li> *     <li>{Directory} *         fileCount entries with the following structure:</li> *         <ul> *             <li>long dataOffset</li> *             <li>String fileName</li> *         </ul> *     <li>{File Data} *         fileCount entries with the raw data of the corresponding file</li> * </ul> * * The fileCount integer indicates how many files are contained in this compound * file. The {directory} that follows has that many entries. Each directory entry * contains a long pointer to the start of this file's data section, and a String * with that file's name. * * * @version $Id: CompoundFileWriter.java 690539 2008-08-30 17:33:06Z mikemccand $ */final class CompoundFileWriter {    private static final class FileEntry {        /** source file */        String file;        /** temporary holder for the start of directory entry for this file */        long directoryOffset;        /** temporary holder for the start of this file's data section */        long dataOffset;    }    private Directory directory;    private String fileName;    private HashSet ids;    private LinkedList entries;    private boolean merged = false;    private SegmentMerger.CheckAbort checkAbort;    /** Create the compound stream in the specified file. The file name is the     *  entire name (no extensions are added).     *  @throws NullPointerException if <code>dir</code> or <code>name</code> is null     */    public CompoundFileWriter(Directory dir, String name) {      this(dir, name, null);    }    CompoundFileWriter(Directory dir, String name, SegmentMerger.CheckAbort checkAbort) {        if (dir == null)            throw new NullPointerException("directory cannot be null");        if (name == null)            throw new NullPointerException("name cannot be null");        this.checkAbort = checkAbort;        directory = dir;        fileName = name;        ids = new HashSet();        entries = new LinkedList();    }    /** Returns the directory of the compound file. */    public Directory getDirectory() {        return directory;    }    /** Returns the name of the compound file. */    public String getName() {        return fileName;    }    /** Add a source stream. <code>file</code> is the string by which the      *  sub-stream will be known in the compound stream.     *      *  @throws IllegalStateException if this writer is closed     *  @throws NullPointerException if <code>file</code> is null     *  @throws IllegalArgumentException if a file with the same name     *   has been added already     */    public void addFile(String file) {        if (merged)            throw new IllegalStateException(                "Can't add extensions after merge has been called");        if (file == null)            throw new NullPointerException(                "file cannot be null");        if (! ids.add(file))            throw new IllegalArgumentException(                "File " + file + " already added");        FileEntry entry = new FileEntry();        entry.file = file;        entries.add(entry);    }    /** Merge files with the extensions added up to now.     *  All files with these extensions are combined sequentially into the     *  compound stream. After successful merge, the source files     *  are deleted.     *  @throws IllegalStateException if close() had been called before or     *   if no file has been added to this object     */    public void close() throws IOException {        if (merged)            throw new IllegalStateException(                "Merge already performed");        if (entries.isEmpty())            throw new IllegalStateException(                "No entries to merge have been defined");        merged = true;        // open the compound stream        IndexOutput os = null;        try {            os = directory.createOutput(fileName);            // Write the number of entries            os.writeVInt(entries.size());            // Write the directory with all offsets at 0.            // Remember the positions of directory entries so that we can            // adjust the offsets later            Iterator it = entries.iterator();            long totalSize = 0;            while(it.hasNext()) {                FileEntry fe = (FileEntry) it.next();                fe.directoryOffset = os.getFilePointer();                os.writeLong(0);    // for now                os.writeString(fe.file);                totalSize += directory.fileLength(fe.file);            }            // Pre-allocate size of file as optimization --            // this can potentially help IO performance as            // we write the file and also later during            // searching.  It also uncovers a disk-full            // situation earlier and hopefully without            // actually filling disk to 100%:            final long finalLength = totalSize+os.getFilePointer();            os.setLength(finalLength);            // Open the files and copy their data into the stream.            // Remember the locations of each file's data section.            byte buffer[] = new byte[16384];            it = entries.iterator();            while(it.hasNext()) {                FileEntry fe = (FileEntry) it.next();                fe.dataOffset = os.getFilePointer();                copyFile(fe, os, buffer);            }            // Write the data offsets into the directory of the compound stream            it = entries.iterator();            while(it.hasNext()) {                FileEntry fe = (FileEntry) it.next();                os.seek(fe.directoryOffset);                os.writeLong(fe.dataOffset);            }            assert finalLength == os.length();            // Close the output stream. Set the os to null before trying to            // close so that if an exception occurs during the close, the            // finally clause below will not attempt to close the stream            // the second time.            IndexOutput tmp = os;            os = null;            tmp.close();        } finally {            if (os != null) try { os.close(); } catch (IOException e) { }        }    }    /** Copy the contents of the file with specified extension into the     *  provided output stream. Use the provided buffer for moving data     *  to reduce memory allocation.     */    private void copyFile(FileEntry source, IndexOutput os, byte buffer[])    throws IOException    {        IndexInput is = null;        try {            long startPtr = os.getFilePointer();            is = directory.openInput(source.file);            long length = is.length();            long remainder = length;            int chunk = buffer.length;            while(remainder > 0) {                int len = (int) Math.min(chunk, remainder);                is.readBytes(buffer, 0, len, false);                os.writeBytes(buffer, len);                remainder -= len;                if (checkAbort != null)                  // Roughly every 2 MB we will check if                  // it's time to abort                  checkAbort.work(80);            }            // Verify that remainder is 0            if (remainder != 0)                throw new IOException(                    "Non-zero remainder length after copying: " + remainder                    + " (id: " + source.file + ", length: " + length                    + ", buffer size: " + chunk + ")");            // Verify that the output length diff is equal to original file            long endPtr = os.getFilePointer();            long diff = endPtr - startPtr;            if (diff != length)                throw new IOException(                    "Difference in the output file offsets " + diff                    + " does not match the original file length " + length);        } finally {            if (is != null) is.close();        }    }}

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产夫妻精品视频| 亚洲精品国产品国语在线app| 日韩电影在线免费看| 欧美专区在线观看一区| 天堂av在线一区| 日韩一区二区免费在线电影| 精品夜夜嗨av一区二区三区| 欧美va亚洲va| 国产成人午夜精品5599| 亚洲欧美综合另类在线卡通| 欧美日韩免费电影| 国产一区二区三区在线观看精品| 国产欧美日韩三区| 色8久久人人97超碰香蕉987| 日韩中文欧美在线| 精品电影一区二区三区| 成人激情小说乱人伦| 一二三四区精品视频| 日韩三级免费观看| 成人成人成人在线视频| 亚洲高清不卡在线观看| www国产精品av| 91免费精品国自产拍在线不卡| 亚洲小少妇裸体bbw| 2022国产精品视频| 色综合夜色一区| 国产一区二区视频在线播放| 亚洲国产精品v| 欧美性色综合网| 国模大尺度一区二区三区| 一区二区视频在线| 欧美成人女星排名| 色综合天天综合在线视频| 日本三级韩国三级欧美三级| 欧美激情艳妇裸体舞| 欧美色图一区二区三区| 国产精品白丝av| 亚洲成人精品一区| 国产精品国产三级国产三级人妇 | 欧美日韩一级二级| 国产精品一区二区三区99| 亚洲电影一级片| 国产精品久久久爽爽爽麻豆色哟哟 | 中文字幕成人av| 91精品国产免费| 91香蕉视频污| 岛国av在线一区| 精东粉嫩av免费一区二区三区| 亚洲最新在线观看| 日韩美女精品在线| 2020国产精品| 日韩精品一区在线| 欧美日韩黄色一区二区| 91香蕉视频在线| 成人黄色免费短视频| 精品一区二区日韩| 久久精品噜噜噜成人88aⅴ | 亚洲视频网在线直播| 精品欧美久久久| 欧美一区二区日韩| 欧美日韩视频专区在线播放| 97精品电影院| 93久久精品日日躁夜夜躁欧美| 国产精品亚洲一区二区三区在线| 麻豆精品一二三| 五月综合激情日本mⅴ| 亚洲一区电影777| 亚洲欧洲制服丝袜| **性色生活片久久毛片| 久久久99久久精品欧美| 欧美成va人片在线观看| 日韩视频一区在线观看| 欧美二区在线观看| 制服丝袜亚洲网站| 欧美一区二区国产| 欧美一级欧美三级在线观看| 欧美日韩电影在线| 91精品免费观看| 制服丝袜日韩国产| 91.com视频| 日韩精品在线网站| 国产性色一区二区| 国产精品欧美一级免费| 国产精品拍天天在线| 中文字幕色av一区二区三区| 亚洲色图20p| 一区二区三区四区不卡在线| 亚洲午夜三级在线| 午夜精品成人在线视频| 日本在线不卡视频| 精品一区二区三区免费播放| 国产成人在线免费| 91社区在线播放| 欧美日韩一区二区三区免费看| 91精品国产综合久久久久久漫画| 日韩免费观看高清完整版在线观看| 日韩欧美国产系列| 日本一区二区三级电影在线观看| 国产精品久久夜| 亚洲二区视频在线| 老司机免费视频一区二区| 国产一区二区三区精品视频| 粉嫩aⅴ一区二区三区四区五区| 色婷婷综合久久久中文字幕| 欧美美女视频在线观看| 精品第一国产综合精品aⅴ| 国产精品久久久久9999吃药| 亚洲一二三区在线观看| 国产在线视视频有精品| 91麻豆免费观看| 日韩一区二区中文字幕| 日本一区二区三区电影| 亚洲一区二区三区四区中文字幕| 蜜桃视频在线观看一区二区| av在线一区二区| 欧美一区二区三区日韩视频| 欧美激情一区二区三区蜜桃视频| 夜夜精品浪潮av一区二区三区| 国产一区二区网址| 欧美三级蜜桃2在线观看| 国产午夜亚洲精品羞羞网站| 亚洲电影一级片| 成人精品视频一区二区三区尤物| 欧美日韩成人综合天天影院 | 一本大道久久精品懂色aⅴ| 欧美一区二区三区在线电影| 国产精品免费网站在线观看| 日本伊人午夜精品| 成人午夜电影网站| 日韩午夜激情视频| 亚洲自拍偷拍九九九| 蜜臀久久99精品久久久久久9| 波多野结衣中文一区| 欧美一级视频精品观看| 日韩美女精品在线| 国产伦精品一区二区三区免费| 欧美最新大片在线看| 国产精品污网站| 九色|91porny| 在线观看视频一区二区欧美日韩| 久久久亚洲精品石原莉奈| 天天综合天天综合色| 91美女福利视频| 国产精品视频一二三| 国产在线观看一区二区| 在线不卡一区二区| 悠悠色在线精品| 成人激情校园春色| 精品国内片67194| 蜜桃一区二区三区在线| 欧美日韩一区成人| 亚洲免费三区一区二区| 粉嫩aⅴ一区二区三区四区| 欧美刺激午夜性久久久久久久| 午夜精品久久久久久| 色噜噜夜夜夜综合网| 亚洲精品五月天| 99久久婷婷国产综合精品| 国产精品免费视频网站| 成人毛片视频在线观看| 国产欧美一区二区三区在线看蜜臀| 男人操女人的视频在线观看欧美| 欧美日韩亚洲综合在线| 亚洲高清在线视频| 欧美挠脚心视频网站| 亚洲一区二区三区免费视频| 欧美中文字幕一区二区三区亚洲| 樱桃国产成人精品视频| 在线亚洲高清视频| 一区二区三区av电影| 在线观看91精品国产入口| 亚洲一二三四区不卡| 欧美蜜桃一区二区三区| 亚洲超碰97人人做人人爱| 91精品视频网| 精品一区二区日韩| 中文字幕乱码久久午夜不卡| 成人av资源在线观看| 亚洲人被黑人高潮完整版| 欧美日韩一区二区在线观看视频| 午夜精品福利一区二区蜜股av| 日韩欧美一区二区免费| 国内精品视频一区二区三区八戒| 久久综合久久99| 92精品国产成人观看免费| 亚洲伊人色欲综合网| 777欧美精品| 精品午夜一区二区三区在线观看| 久久久五月婷婷| va亚洲va日韩不卡在线观看| 亚洲激情一二三区| 538在线一区二区精品国产| 久久99热狠狠色一区二区| 国产欧美日韩三区| 在线精品视频一区二区三四| 日韩一区精品字幕| 中国av一区二区三区| 欧美视频中文字幕| 国产一区二区在线视频| 一区二区三区美女|