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

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

?? poifsfilesystem.java

?? java 報(bào)表 to office文檔: 本包由java語(yǔ)言開(kāi)發(fā)
?? JAVA
字號(hào):
/* ====================================================================   Copyright 2002-2004   Apache Software Foundation   Licensed 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.==================================================================== */package org.apache.poi.poifs.filesystem;import java.io.*;import java.util.*;//import org.apache.poi.poifs.common.POIFSConstants;import org.apache.poi.poifs.dev.POIFSViewable;import org.apache.poi.poifs.property.DirectoryProperty;//import org.apache.poi.poifs.property.DocumentProperty;import org.apache.poi.poifs.property.Property;import org.apache.poi.poifs.property.PropertyTable;import org.apache.poi.poifs.storage.BATBlock;import org.apache.poi.poifs.storage.BlockAllocationTableReader;import org.apache.poi.poifs.storage.BlockAllocationTableWriter;import org.apache.poi.poifs.storage.BlockList;import org.apache.poi.poifs.storage.BlockWritable;import org.apache.poi.poifs.storage.HeaderBlockReader;import org.apache.poi.poifs.storage.HeaderBlockWriter;//import org.apache.poi.poifs.storage.RawDataBlock;import org.apache.poi.poifs.storage.RawDataBlockList;import org.apache.poi.poifs.storage.SmallBlockTableReader;import org.apache.poi.poifs.storage.SmallBlockTableWriter;//import org.apache.poi.poifs.storage.SmallDocumentBlock;/** * This is the main class of the POIFS system; it manages the entire * life cycle of the filesystem. * * @author Marc Johnson (mjohnson at apache dot org) */public class POIFSFileSystem    implements POIFSViewable{    private PropertyTable _property_table;    private List          _documents;    private DirectoryNode _root;    /**     * Constructor, intended for writing     */    public POIFSFileSystem()    {        _property_table = new PropertyTable();        _documents      = new ArrayList();        _root           = null;    }    /**     * Create a POIFSFileSystem from an InputStream     *     * @param stream the InputStream from which to read the data     *     * @exception IOException on errors reading, or on invalid data     */    public POIFSFileSystem(final InputStream stream)        throws IOException    {        this();        // read the header block from the stream        HeaderBlockReader header_block_reader = new HeaderBlockReader(stream);        // read the rest of the stream into blocks        RawDataBlockList  data_blocks         = new RawDataBlockList(stream);        // set up the block allocation table (necessary for the        // data_blocks to be manageable        new BlockAllocationTableReader(header_block_reader.getBATCount(),                                       header_block_reader.getBATArray(),                                       header_block_reader.getXBATCount(),                                       header_block_reader.getXBATIndex(),                                       data_blocks);        // get property table from the document        PropertyTable properties =            new PropertyTable(header_block_reader.getPropertyStart(),                              data_blocks);        // init documents        processProperties(SmallBlockTableReader            .getSmallDocumentBlocks(data_blocks, properties                .getRoot(), header_block_reader                    .getSBATStart()), data_blocks, properties.getRoot()                        .getChildren(), null);    }    /**     * Create a new document to be added to the root directory     *     * @param stream the InputStream from which the document's data     *               will be obtained     * @param name the name of the new POIFSDocument     *     * @return the new DocumentEntry     *     * @exception IOException on error creating the new POIFSDocument     */    public DocumentEntry createDocument(final InputStream stream,                                        final String name)        throws IOException    {        return getRoot().createDocument(name, stream);    }    /**     * create a new DocumentEntry in the root entry; the data will be     * provided later     *     * @param name the name of the new DocumentEntry     * @param size the size of the new DocumentEntry     * @param writer the writer of the new DocumentEntry     *     * @return the new DocumentEntry     *     * @exception IOException     */    public DocumentEntry createDocument(final String name, final int size,                                        final POIFSWriterListener writer)        throws IOException    {        return getRoot().createDocument(name, size, writer);    }    /**     * create a new DirectoryEntry in the root directory     *     * @param name the name of the new DirectoryEntry     *     * @return the new DirectoryEntry     *     * @exception IOException on name duplication     */    public DirectoryEntry createDirectory(final String name)        throws IOException    {        return getRoot().createDirectory(name);    }    /**     * Write the filesystem out     *     * @param stream the OutputStream to which the filesystem will be     *               written     *     * @exception IOException thrown on errors writing to the stream     */    public void writeFilesystem(final OutputStream stream)        throws IOException    {        // get the property table ready        _property_table.preWrite();        // create the small block store, and the SBAT        SmallBlockTableWriter      sbtw       =            new SmallBlockTableWriter(_documents, _property_table.getRoot());        // create the block allocation table        BlockAllocationTableWriter bat        =            new BlockAllocationTableWriter();        // create a list of BATManaged objects: the documents plus the        // property table and the small block table        List                       bm_objects = new ArrayList();        bm_objects.addAll(_documents);        bm_objects.add(_property_table);        bm_objects.add(sbtw);        bm_objects.add(sbtw.getSBAT());        // walk the list, allocating space for each and assigning each        // a starting block number        Iterator iter = bm_objects.iterator();        while (iter.hasNext())        {            BATManaged bmo         = ( BATManaged ) iter.next();            int        block_count = bmo.countBlocks();            if (block_count != 0)            {                bmo.setStartBlock(bat.allocateSpace(block_count));            }            else            {                // Either the BATManaged object is empty or its data                // is composed of SmallBlocks; in either case,                // allocating space in the BAT is inappropriate            }        }        // allocate space for the block allocation table and take its        // starting block        int               batStartBlock       = bat.createBlocks();        // get the extended block allocation table blocks        HeaderBlockWriter header_block_writer = new HeaderBlockWriter();        BATBlock[]        xbat_blocks         =            header_block_writer.setBATBlocks(bat.countBlocks(),                                             batStartBlock);        // set the property table start block        header_block_writer.setPropertyStart(_property_table.getStartBlock());        // set the small block allocation table start block        header_block_writer.setSBATStart(sbtw.getSBAT().getStartBlock());        // set the small block allocation table block count        header_block_writer.setSBATBlockCount(sbtw.getSBATBlockCount());        // the header is now properly initialized. Make a list of        // writers (the header block, followed by the documents, the        // property table, the small block store, the small block        // allocation table, the block allocation table, and the        // extended block allocation table blocks)        List writers = new ArrayList();        writers.add(header_block_writer);        writers.addAll(_documents);        writers.add(_property_table);        writers.add(sbtw);        writers.add(sbtw.getSBAT());        writers.add(bat);        for (int j = 0; j < xbat_blocks.length; j++)        {            writers.add(xbat_blocks[ j ]);        }        // now, write everything out        iter = writers.iterator();        while (iter.hasNext())        {            BlockWritable writer = ( BlockWritable ) iter.next();            writer.writeBlocks(stream);        }    }    /**     * read in a file and write it back out again     *     * @param args names of the files; arg[ 0 ] is the input file,     *             arg[ 1 ] is the output file     *     * @exception IOException     */    public static void main(String args[])        throws IOException    {        if (args.length != 2)        {            System.err.println(                "two arguments required: input filename and output filename");            System.exit(1);        }        FileInputStream  istream = new FileInputStream(args[ 0 ]);        FileOutputStream ostream = new FileOutputStream(args[ 1 ]);        new POIFSFileSystem(istream).writeFilesystem(ostream);        istream.close();        ostream.close();    }    /**     * get the root entry     *     * @return the root entry     */    public DirectoryEntry getRoot()    {        if (_root == null)        {            _root = new DirectoryNode(_property_table.getRoot(), this, null);        }        return _root;    }    /**     * open a document in the root entry's list of entries     *     * @param documentName the name of the document to be opened     *     * @return a newly opened DocumentInputStream     *     * @exception IOException if the document does not exist or the     *            name is that of a DirectoryEntry     */    public DocumentInputStream createDocumentInputStream(            final String documentName)        throws IOException    {        Entry document = getRoot().getEntry(documentName);        if (!document.isDocumentEntry())        {            throw new IOException("Entry '" + documentName                                  + "' is not a DocumentEntry");        }        return new DocumentInputStream(( DocumentEntry ) document);    }    /**     * add a new POIFSDocument     *     * @param document the POIFSDocument being added     */    void addDocument(final POIFSDocument document)    {        _documents.add(document);        _property_table.addProperty(document.getDocumentProperty());    }    /**     * add a new DirectoryProperty     *     * @param directory the DirectoryProperty being added     */    void addDirectory(final DirectoryProperty directory)    {        _property_table.addProperty(directory);    }    /**     * remove an entry     *     * @param entry to be removed     */    void remove(EntryNode entry)    {        _property_table.removeProperty(entry.getProperty());        if (entry.isDocumentEntry())        {            _documents.remove((( DocumentNode ) entry).getDocument());        }    }    private void processProperties(final BlockList small_blocks,                                   final BlockList big_blocks,                                   final Iterator properties,                                   final DirectoryNode dir)        throws IOException    {        while (properties.hasNext())        {            Property      property = ( Property ) properties.next();            String        name     = property.getName();            DirectoryNode parent   = (dir == null)                                     ? (( DirectoryNode ) getRoot())                                     : dir;            if (property.isDirectory())            {                DirectoryNode new_dir =                    ( DirectoryNode ) parent.createDirectory(name);                new_dir.setStorageClsid( property.getStorageClsid() );                processProperties(                    small_blocks, big_blocks,                    (( DirectoryProperty ) property).getChildren(), new_dir);            }            else            {                int           startBlock = property.getStartBlock();                int           size       = property.getSize();                POIFSDocument document   = null;                if (property.shouldUseSmallBlocks())                {                    document =                        new POIFSDocument(name, small_blocks                            .fetchBlocks(startBlock), size);                }                else                {                    document =                        new POIFSDocument(name,                                          big_blocks.fetchBlocks(startBlock),                                          size);                }                parent.createDocument(document);            }        }    }    /* ********** START begin implementation of POIFSViewable ********** */    /**     * Get an array of objects, some of which may implement     * POIFSViewable     *     * @return an array of Object; may not be null, but may be empty     */    public Object [] getViewableArray()    {        if (preferArray())        {            return (( POIFSViewable ) getRoot()).getViewableArray();        }        else        {            return new Object[ 0 ];        }    }    /**     * Get an Iterator of objects, some of which may implement     * POIFSViewable     *     * @return an Iterator; may not be null, but may have an empty     * back end store     */    public Iterator getViewableIterator()    {        if (!preferArray())        {            return (( POIFSViewable ) getRoot()).getViewableIterator();        }        else        {            return Collections.EMPTY_LIST.iterator();        }    }    /**     * Give viewers a hint as to whether to call getViewableArray or     * getViewableIterator     *     * @return true if a viewer should call getViewableArray, false if     *         a viewer should call getViewableIterator     */    public boolean preferArray()    {        return (( POIFSViewable ) getRoot()).preferArray();    }    /**     * Provides a short description of the object, to be used when a     * POIFSViewable object has not provided its contents.     *     * @return short description     */    public String getShortDescription()    {        return "POIFS FileSystem";    }    /* **********  END  begin implementation of POIFSViewable ********** */}   // end public class POIFSFileSystem

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲一区二区三区视频在线播放| 欧美日本一道本| 国产精品麻豆久久久| 国产福利一区二区三区视频| 久久久久9999亚洲精品| 国产成人精品免费看| 国产精品美女久久久久aⅴ| 风间由美一区二区三区在线观看| 亚洲国产高清aⅴ视频| 成人高清在线视频| 亚洲成人手机在线| 精品入口麻豆88视频| 国产麻豆一精品一av一免费 | 欧美精品一区二区三区蜜桃| 国产在线播放一区二区三区| 亚洲天堂久久久久久久| 欧美日韩高清一区二区不卡| 麻豆一区二区99久久久久| 久久久久久99精品| 色综合色综合色综合色综合色综合| 亚洲一区成人在线| www精品美女久久久tv| 99久久精品99国产精品 | 国产精品乱码一区二区三区软件| 色天天综合色天天久久| 免费观看在线综合| 国产精品拍天天在线| 91色婷婷久久久久合中文| 天天综合色天天综合| 国产日韩三级在线| 欧美日韩国产在线观看| 国产精品一区二区黑丝| 午夜不卡av在线| 国产欧美日韩在线| 7777精品伊人久久久大香线蕉完整版| 国产呦萝稀缺另类资源| 亚洲444eee在线观看| 欧美激情资源网| 日韩一区二区在线观看| 色综合咪咪久久| 国产一区二区在线电影| 亚洲风情在线资源站| 国产精品日韩成人| 日韩午夜av电影| 欧美视频在线一区| av一区二区三区| 欧美视频在线一区二区三区| 亚洲蜜臀av乱码久久精品蜜桃| 欧美变态凌虐bdsm| 欧美日韩国产中文| 色吊一区二区三区| 99视频超级精品| 精品一区二区三区免费视频| 亚洲一二三区不卡| 亚洲美女在线一区| 国产精品乱子久久久久| 亚洲精品一区二区精华| 91精品国产综合久久精品| 91久久久免费一区二区| av在线不卡电影| 成人激情免费视频| 国产一区在线看| 精品制服美女丁香| 免费成人在线观看| 水野朝阳av一区二区三区| 亚洲综合在线视频| 一区二区三区蜜桃| 一区二区三区免费网站| 成人免费一区二区三区在线观看| 国产日韩影视精品| 久久久久久电影| 久久精品亚洲麻豆av一区二区 | 欧美丰满一区二区免费视频 | 欧美乱妇20p| 欧美色爱综合网| 欧美日韩一区二区三区高清| 欧美在线999| 欧美日韩在线一区二区| 欧美久久久影院| 91精品国产一区二区人妖| 欧美日本韩国一区二区三区视频| 91国产福利在线| 欧美日韩国产123区| 日韩一区二区电影| 久久久99久久| 一区免费观看视频| 一区二区三区在线不卡| 尤物av一区二区| 亚洲国产中文字幕| 日韩国产欧美三级| 国产在线播精品第三| 国产成人免费高清| 91麻豆6部合集magnet| 色哟哟一区二区在线观看| 色狠狠色狠狠综合| 制服丝袜av成人在线看| 久久亚洲影视婷婷| 大白屁股一区二区视频| 免费成人av资源网| 国产精品影视在线观看| 懂色av中文字幕一区二区三区| 成人精品一区二区三区四区| av一区二区不卡| 欧美日韩精品一区二区三区蜜桃| 欧美精品日韩一本| 久久蜜桃av一区二区天堂| 国产精品久久久久毛片软件| 亚洲第一av色| 国产精品一区二区你懂的| 色激情天天射综合网| 91精品国产麻豆| 国产精品免费网站在线观看| 伊人夜夜躁av伊人久久| 蜜臀va亚洲va欧美va天堂| 风间由美性色一区二区三区| 欧美三级欧美一级| 国产欧美日韩久久| 亚洲不卡一区二区三区| 国产乱色国产精品免费视频| 欧洲精品中文字幕| 久久亚洲精精品中文字幕早川悠里 | 9色porny自拍视频一区二区| 麻豆成人免费电影| 一区二区激情视频| 久国产精品韩国三级视频| 欧美激情一区二区三区蜜桃视频 | 蜜臀av国产精品久久久久| 国产综合色在线| 在线日韩av片| 久久久久久久久久看片| 亚洲五月六月丁香激情| 国产精品一区二区果冻传媒| 欧美精品自拍偷拍动漫精品| 国产精品美女久久久久久久| 视频在线观看一区二区三区| 91蜜桃传媒精品久久久一区二区| 日韩区在线观看| 亚洲一区二区成人在线观看| 成人三级在线视频| 欧美成人一区二区| 亚洲一二三级电影| 91免费版在线看| 中文字幕国产一区二区| 免费在线观看不卡| 91国产免费观看| 亚洲人成在线播放网站岛国| 成人一区二区三区| 337p日本欧洲亚洲大胆色噜噜| 亚洲成av人影院| 91国内精品野花午夜精品| 国产精品久久久久久久浪潮网站| 久久99精品久久久久久| 欧美福利视频导航| 午夜婷婷国产麻豆精品| 在线视频国内一区二区| 亚洲视频免费在线观看| 成人黄色av电影| 国产欧美精品日韩区二区麻豆天美| 蜜桃视频在线一区| 日韩欧美一级在线播放| 石原莉奈一区二区三区在线观看| 欧美在线free| 亚洲一区二区在线免费看| 色婷婷久久久亚洲一区二区三区 | 欧美日本乱大交xxxxx| 亚洲成人av在线电影| 51精品久久久久久久蜜臀| 日本不卡一二三| 国产偷v国产偷v亚洲高清| 日韩你懂的电影在线观看| 国产91精品一区二区麻豆亚洲| 精品奇米国产一区二区三区| 国产成人午夜精品5599| 精品动漫一区二区三区在线观看| 亚洲已满18点击进入久久| 色婷婷久久久亚洲一区二区三区| 亚洲精品欧美专区| 欧美日韩综合在线| 亚洲一区二区综合| 欧美精品自拍偷拍动漫精品| 男女性色大片免费观看一区二区| 日韩三级.com| 国产精品911| 亚洲激情在线播放| 欧美男女性生活在线直播观看| 日韩电影在线观看一区| 精品国产91乱码一区二区三区| 国产综合一区二区| ●精品国产综合乱码久久久久| 在线观看成人免费视频| 免费人成网站在线观看欧美高清| 精品久久久影院| 9久草视频在线视频精品| 亚洲一级二级在线| 精品久久国产字幕高潮| 成人av中文字幕| 亚洲18影院在线观看| 久久久久久久性| 一本大道久久a久久精二百| 婷婷国产在线综合|