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

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

?? compoundfile.java3

?? java讀寫Excel文檔的API
?? JAVA3
?? 第 1 頁 / 共 2 頁
字號:
   */
  private void writeHeader() throws IOException
  {
    logger.debug("num extensions blocks for header:  " + numExtensionBlocks);
    // Build up the header array
    byte[] headerBlock = new byte[BIG_BLOCK_SIZE];
    byte[] extensionBlockData = new byte[BIG_BLOCK_SIZE * numExtensionBlocks];

    // Copy in the identifier
    System.arraycopy(IDENTIFIER, 0, headerBlock, 0, IDENTIFIER.length);

    // Copy in some magic values - no idea what they mean
    headerBlock[0x18] = 0x3e;
    headerBlock[0x1a] = 0x3;
    headerBlock[0x1c] = (byte) 0xfe;
    headerBlock[0x1d] = (byte) 0xff;
    headerBlock[0x1e] = 0x9;
    headerBlock[0x20] = 0x6;
    headerBlock[0x39] = 0x10;

    // Set the number of BBD blocks
    IntegerHelper.getFourBytes(numBigBlockDepotBlocks, 
                               headerBlock, 
                               NUM_BIG_BLOCK_DEPOT_BLOCKS_POS);  

    // Set the small block depot chain to -2 ie. no small block chain
    IntegerHelper.getFourBytes(-2,
                               headerBlock,
                               SMALL_BLOCK_DEPOT_BLOCK_POS);

    // Set the extension block 
    IntegerHelper.getFourBytes(extensionBlock,
                               headerBlock,
                               EXTENSION_BLOCK_POS);

    // Set the number of extension blocks to be the number of BBD blocks - 1
    IntegerHelper.getFourBytes(numExtensionBlocks,
                               headerBlock, 
                               NUM_EXTENSION_BLOCK_POS);
    
    // Set the root start block
    IntegerHelper.getFourBytes(rootStartBlock,
                               headerBlock,
                               ROOT_START_BLOCK_POS);

    // Set the block numbers for the BBD.  Set the BBD running 
    // after the excel data and summary information
    int pos = BIG_BLOCK_DEPOT_BLOCKS_POS;

    // See how many blocks fit into the header
    int blocksToWrite = Math.min(numBigBlockDepotBlocks, 
                                 (BIG_BLOCK_SIZE - 
                                  BIG_BLOCK_DEPOT_BLOCKS_POS)/4);
    int extensionBlock = 0;
    int blocksWritten = 0;

    for (int i = 0 ; i < blocksToWrite; i++)
    {
      IntegerHelper.getFourBytes(bbdStartBlock + i, 
                                 headerBlock,
                                 pos);
      pos += 4;
      blocksWritten++;
    }
    
    // Pad out the rest of the header with blanks
    for (int i = pos; i < BIG_BLOCK_SIZE; i++)
    {
      headerBlock[i] = (byte) 0xff;
    }

    out.write(headerBlock);

    // Write out the extension blocks
    pos = 0;

    for (int extBlock = 0; extBlock < numExtensionBlocks; extBlock++)
    {
      blocksToWrite = Math.min(numBigBlockDepotBlocks - blocksWritten, 
                               BIG_BLOCK_SIZE/4 -1);

      for(int j = 0 ; j < blocksToWrite; j++)
      {
        IntegerHelper.getFourBytes(bbdStartBlock + blocksWritten + j, 
                                   extensionBlockData,
                                   pos);
        pos += 4;
      }

      blocksWritten += blocksToWrite;

      // Indicate the next block, or the termination of the chain
      int nextBlock = (blocksWritten == numBigBlockDepotBlocks) ? 
                              -2 : extBlock+1 ;
      IntegerHelper.getFourBytes(nextBlock, extensionBlockData, pos);
      pos +=4;
    }

    if (numExtensionBlocks > 0)
    {
      // Pad out the rest of the extension block with blanks
      for (int i = pos; i < extensionBlockData.length; i++)
      {
        extensionBlockData[i] = (byte) 0xff;
      }

      out.write(extensionBlockData);
    }
  }

  /**
   * Checks that the data can fit into the current BBD block.  If not,
   * then it moves on to the next block
   * 
   * @exception IOException 
   */
  private void checkBbdPos() throws IOException
  {
    if (bbdPos >= BIG_BLOCK_SIZE)
    {
      // Write out the extension block.  This will simply be the next block
      out.write(bigBlockDepot);
      
      // Create a new block
      bigBlockDepot = new byte[BIG_BLOCK_SIZE];
      bbdPos = 0;
    }
  }

  /**
   * Writes out the big block chain
   *
   * @param startBlock the starting block of the big block chain
   * @param numBlocks the number of blocks in the chain
   * @exception IOException
   */
  private void writeBlockChain(int startBlock, int numBlocks) 
    throws IOException
  {
    int blocksToWrite = numBlocks - 1;
    int blockNumber   = startBlock + 1;
    
    while (blocksToWrite > 0)
    {
      int bbdBlocks = Math.min(blocksToWrite, (BIG_BLOCK_SIZE - bbdPos)/4);

      for (int i = 0 ; i < bbdBlocks; i++)
      {
        IntegerHelper.getFourBytes(blockNumber, bigBlockDepot, bbdPos);
        bbdPos +=4 ;
        blockNumber++;
      }
      
      blocksToWrite -= bbdBlocks;
      checkBbdPos();
    }

    // Write the end of the block chain 
    IntegerHelper.getFourBytes(-2, bigBlockDepot, bbdPos);
    bbdPos += 4;
    checkBbdPos();
  }

  /**
   * Writes the block chains for the additional property sets
   *
   * @exception IOException
   */
  private void writeAdditionalPropertySetBlockChains() throws IOException
  {
    if (additionalPropertySets == null)
    {
      return;
    }

    int blockNumber = excelDataStartBlock + excelDataBlocks + 16;

    int numBlocks2 = rootEntryPropertySet.data.length >= SMALL_BLOCK_THRESHOLD ?
      getBigBlocksRequired(rootEntryPropertySet.data.length) :
      SMALL_BLOCK_THRESHOLD / BIG_BLOCK_SIZE;

    String psname2 = rootEntryPropertySet.propertyStorage.name;
    logger.debug("writing big block chain for  " + psname2 + " block " + blockNumber + " numBlocks " + numBlocks2);
    writeBlockChain(blockNumber, numBlocks2);
    blockNumber += numBlocks2;
    
    for (Iterator i = additionalPropertySets.iterator(); i.hasNext() ; )
    {
      ReadPropertyStorage rps = (ReadPropertyStorage) i.next();

      int numBlocks = rps.data.length >= SMALL_BLOCK_THRESHOLD ?
        getBigBlocksRequired(rps.data.length) :
        SMALL_BLOCK_THRESHOLD / BIG_BLOCK_SIZE;

      String psname = rps.propertyStorage.name;
      logger.debug("writing big block chain for  " + psname + " block " + blockNumber + " numBlocks " + numBlocks);
      writeBlockChain(blockNumber, numBlocks);
      blockNumber += numBlocks;
    }
  }
  
  /**
   * Writes out the Big Block Depot
   * 
   * @exception IOException 
   */
  private void writeBigBlockDepot() throws IOException
  {
    // This is after the excel data, the summary information, the
    // big block property sets and the small block depot
    bigBlockDepot = new byte[BIG_BLOCK_SIZE];
    bbdPos = 0;

    // Write out the extension blocks, indicating them as special blocks
    for (int i = 0 ; i < numExtensionBlocks; i++)
    {
      IntegerHelper.getFourBytes(-3, bigBlockDepot, bbdPos);
      bbdPos += 4;
      checkBbdPos();
    }

    writeBlockChain(excelDataStartBlock, excelDataBlocks);
    
    // The excel data has been written.  Now write out the rest of it

    // Write the block chain for the summary information
    int summaryInfoBlock = excelDataStartBlock + 
      excelDataBlocks + 
      additionalPropertyBlocks;

    for (int i = summaryInfoBlock; i < summaryInfoBlock + 7; i++)
    {
      IntegerHelper.getFourBytes(i + 1, bigBlockDepot, bbdPos);
      bbdPos +=4 ;
      checkBbdPos();
    } 

    // Write the end of the block chain for the summary info block
    IntegerHelper.getFourBytes(-2, bigBlockDepot, bbdPos);
    bbdPos += 4;
    checkBbdPos();

    // Write the block chain for the document summary information
    for (int i = summaryInfoBlock + 8; i < summaryInfoBlock + 15; i++)
    {
      IntegerHelper.getFourBytes(i + 1, bigBlockDepot, bbdPos);
      bbdPos +=4 ;
      checkBbdPos();
    } 

    // Write the end of the block chain for the document summary
    IntegerHelper.getFourBytes(-2, bigBlockDepot, bbdPos);
    bbdPos += 4;
    checkBbdPos();

    // Write out the block chain for the copied property sets, if present
    writeAdditionalPropertySetBlockChains();

    // The Big Block Depot immediately follows the document summary.  Denote 
    // these as a special block
    for (int i = 0; i < numBigBlockDepotBlocks; i++)
    {
      IntegerHelper.getFourBytes(-3, bigBlockDepot, bbdPos);
      bbdPos += 4;
      checkBbdPos();
    }

    // Write the root entry
    writeBlockChain(rootStartBlock, numRootEntryBlocks);

    // Pad out the remainder of the block
    if (bbdPos != 0)
    {
      for (int i = bbdPos; i < BIG_BLOCK_SIZE; i++)
      {
        bigBlockDepot[i] = (byte) 0xff;
      }
      out.write(bigBlockDepot);
    }
  }

  /**
   * Calculates the number of big blocks required to store data of the 
   * specified length
   *
   * @param length the length of the data
   * @return the number of big blocks required to store the data
   */
  private int getBigBlocksRequired(int length)
  {
    int blocks = length / BIG_BLOCK_SIZE;
    
    return (length % BIG_BLOCK_SIZE > 0 )? blocks + 1 : blocks;
  }

  /**
   * Calculates the number of small blocks required to store data of the 
   * specified length
   *
   * @param length the length of the data
   * @return the number of small blocks required to store the data
   */
  private int getSmallBlocksRequired(int length)
  {
    int blocks = length / SMALL_BLOCK_SIZE;
    
    return (length % SMALL_BLOCK_SIZE > 0 )? blocks + 1 : blocks;
  }

  /**
   * Writes out the property sets
   * 
   * @exception IOException 
   */
  private void writePropertySets() throws IOException
  {
    byte[] propertySetStorage = new byte[BIG_BLOCK_SIZE * numRootEntryBlocks];

    int pos = 0;
    int[] mappings = null;

    // Build up the mappings array
    if (additionalPropertySets != null)
    {
      mappings = new int[numPropertySets];
      
      // Map the standard ones to the first four
      for (int i = 0 ; i < STANDARD_PROPERTY_SETS.length ; i++)
      {
        ReadPropertyStorage rps = (ReadPropertyStorage) 
          readPropertySets.get(STANDARD_PROPERTY_SETS[i]);
        mappings[rps.number] = i;
      }

      // Now go through the original ones
      int newMapping = STANDARD_PROPERTY_SETS.length;
      for (Iterator i = additionalPropertySets.iterator(); i.hasNext(); )
      {
        ReadPropertyStorage rps = (ReadPropertyStorage) i.next();
        mappings[rps.number] = newMapping;
        newMapping++;
      }
    }

    int dir = 0;
    int previous = 0;
    int next = 0;

    // Set the root entry property set
    PropertyStorage ps = new PropertyStorage(ROOT_ENTRY_NAME);
    ps.setType(5);
    ps.setStartBlock(-2);
    ps.setSize(0);
    ps.setPrevious(-1);
    ps.setNext(-1);
    ps.setColour(0);

    dir = 2;
    if (additionalPropertySets != null)
    {
      ReadPropertyStorage rps = (ReadPropertyStorage) 
                            readPropertySets.get(ROOT_ENTRY_NAME);
      dir = mappings[rps.propertyStorage.directory];
    }
    ps.setDirectory(dir);

    System.arraycopy(ps.data, 0, 
                     propertySetStorage, pos, 
                     PROPERTY_STORAGE_BLOCK_SIZE);
    pos += PROPERTY_STORAGE_BLOCK_SIZE;


    // Set the workbook property set
    ps = new PropertyStorage(WORKBOOK_NAME);
    ps.setType(2);
    ps.setStartBlock(excelDataStartBlock);
      // start the excel data after immediately after this block
    ps.setSize(requiredSize);
      // alway use a big block stream - none of that messing around
      // with small blocks
    ps.setColour(1);
    
    previous = 3;

    if (additionalPropertySets != null)
    {
      ReadPropertyStorage rps = (ReadPropertyStorage) 
        readPropertySets.get(WORKBOOK_NAME);
      previous = mappings[rps.propertyStorage.previous];
    }

    ps.setPrevious(previous);
    ps.setNext(-1);
    ps.setDirectory(-1);
    ps.setColour(1);

    System.arraycopy(ps.data, 0, 
                     propertySetStorage, pos, 
                     PROPERTY_STORAGE_BLOCK_SIZE);
    pos += PROPERTY_STORAGE_BLOCK_SIZE;

    // Set the summary information
    ps = new PropertyStorage(SUMMARY_INFORMATION_NAME);
    ps.setType(2);
    ps.setStartBlock(excelDataStartBlock + excelDataBlocks);
    ps.setSize(SMALL_BLOCK_THRESHOLD);
    ps.setColour(1);

    previous = 1;
    next = 3;

    if (additionalPropertySets != null)
    {
      ReadPropertyStorage rps = (ReadPropertyStorage) 
                            readPropertySets.get(SUMMARY_INFORMATION_NAME);

      previous = rps.propertyStorage.previous != - 1 ?
        mappings[rps.propertyStorage.previous] : -1 ;
      next = rps.propertyStorage.next != - 1 ?
        mappings[rps.propertyStorage.next] : -1 ;
    }

    ps.setPrevious(previous);
    ps.setNext(next);
    ps.setDirectory(-1);
    ps.setColour(1);

    System.arraycopy(ps.data, 0, 
                     propertySetStorage, pos, 
                     PROPERTY_STORAGE_BLOCK_SIZE);
    pos += PROPERTY_STORAGE_BLOCK_SIZE;

    // Set the document summary information
    ps = new PropertyStorage(DOCUMENT_SUMMARY_INFORMATION_NAME);
    ps.setType(2);
    ps.setStartBlock(excelDataStartBlock + excelDataBlocks + 8);
    ps.setSize(SMALL_BLOCK_THRESHOLD);
    ps.setPrevious(-1);
    ps.setNext(-1);
    ps.setDirectory(-1);
    ps.setColour(1);

    System.arraycopy(ps.data, 0, 
                     propertySetStorage, pos, 
                     PROPERTY_STORAGE_BLOCK_SIZE);
    pos += PROPERTY_STORAGE_BLOCK_SIZE;



    // Write out the additional property sets
    if (additionalPropertySets == null)
    {
      out.write(propertySetStorage);
      return;
    }

    int bigBlock = excelDataStartBlock + excelDataBlocks + 16 +
      18;

    for (Iterator i = additionalPropertySets.iterator() ; i.hasNext(); )
    {
      ReadPropertyStorage rps = (ReadPropertyStorage) i.next();
 
      ps = new PropertyStorage(rps.propertyStorage.name);
      ps.setType(rps.propertyStorage.type);
      ps.setStartBlock(bigBlock);
      ps.setSize(Math.max(rps.propertyStorage.size, SMALL_BLOCK_THRESHOLD));

      previous = rps.propertyStorage.previous != -1 ? 
        mappings[rps.propertyStorage.previous] : -1;
      next = rps.propertyStorage.next != -1 ? 
        mappings[rps.propertyStorage.next] : -1;
      dir = rps.propertyStorage.directory != -1 ? 
        mappings[rps.propertyStorage.directory] : -1;

      ps.setPrevious(previous);
      ps.setNext(next);
      ps.setDirectory(dir);
      ps.setColour(1);

      System.arraycopy(ps.data, 0, 
                       propertySetStorage, pos, 
                       PROPERTY_STORAGE_BLOCK_SIZE);
      pos += PROPERTY_STORAGE_BLOCK_SIZE;

      
      if (rps.data.length >= SMALL_BLOCK_THRESHOLD)
      {
        bigBlock += getBigBlocksRequired(rps.data.length);
      }
      else
      {
        bigBlock += SMALL_BLOCK_THRESHOLD / BIG_BLOCK_SIZE;
      }
    }
    
    out.write(propertySetStorage);
  }
}










?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
极品少妇xxxx精品少妇| 亚洲一区在线免费观看| 91女厕偷拍女厕偷拍高清| 强制捆绑调教一区二区| 亚洲日本一区二区三区| 日韩欧美综合在线| 欧美久久久一区| 91丨porny丨国产| 99精品桃花视频在线观看| 精品一区二区三区免费播放| 亚洲第一狼人社区| 亚洲色图制服诱惑| 国产精品嫩草影院com| 精品久久人人做人人爱| 欧美大片在线观看一区| 欧美人体做爰大胆视频| 在线观看日韩高清av| 色综合久久久久网| 97久久人人超碰| 色婷婷综合激情| 91一区一区三区| 99re6这里只有精品视频在线观看| 成人三级伦理片| 暴力调教一区二区三区| 一本大道av一区二区在线播放| 菠萝蜜视频在线观看一区| 成人免费高清视频在线观看| 成人黄色电影在线| 国产自产高清不卡| 国产成人精品一区二| 国产xxx精品视频大全| 成人精品高清在线| 欧美无人高清视频在线观看| 欧美日韩国产美| 欧美成人综合网站| 中文字幕精品三区| 一区二区免费在线| 美女视频网站久久| hitomi一区二区三区精品| 日本久久精品电影| 欧美xingq一区二区| 国产日产欧美一区二区三区| 玉米视频成人免费看| 美国十次综合导航| 99在线精品免费| 欧美本精品男人aⅴ天堂| 奇米影视一区二区三区| 国模套图日韩精品一区二区| 国产麻豆一精品一av一免费| 高清国产一区二区| 色猫猫国产区一区二在线视频| 99久久免费精品高清特色大片| 水蜜桃久久夜色精品一区的特点| 国产一区二区在线观看视频| 一本大道久久精品懂色aⅴ| 日韩一级片在线观看| 国产精品福利影院| 国产一区三区三区| 欧美精品日韩综合在线| 国产精品久久久久久久久图文区| 奇米影视在线99精品| 国产精品久久久久久久久免费桃花| 最新日韩av在线| 国产精品一区二区久久不卡 | 国产精品一区二区男女羞羞无遮挡 | 日本vs亚洲vs韩国一区三区| 91亚洲男人天堂| 亚洲欧美在线另类| 99久久国产综合精品女不卡| 国产欧美日韩一区二区三区在线观看| 首页国产丝袜综合| 在线视频一区二区免费| 亚洲三级在线观看| 91丨九色丨黑人外教| 自拍偷拍国产精品| 99久久精品国产导航| 亚洲人妖av一区二区| 波多野结衣在线aⅴ中文字幕不卡| 久久婷婷久久一区二区三区| 捆绑调教一区二区三区| 欧美成人video| 极品尤物av久久免费看| 国产午夜三级一区二区三| 国产美女精品人人做人人爽| 国产精品色噜噜| 在线免费一区三区| 天天av天天翘天天综合网色鬼国产| 日韩一区二区三区视频| 国产高清不卡一区二区| 国产精品久久久久久久久晋中 | 综合婷婷亚洲小说| 欧美日韩国产一区| 国产高清视频一区| 亚洲综合色网站| 国产三级三级三级精品8ⅰ区| 不卡视频一二三| 美女性感视频久久| 一区二区三区精品视频在线| www.日本不卡| 成人国产精品免费观看动漫| 亚洲精品少妇30p| 日韩精品一区二区三区swag| 成人黄色在线视频| 五月天亚洲精品| 亚洲柠檬福利资源导航| 久久无码av三级| 日韩一区二区三区av| 在线观看不卡一区| 不卡视频一二三四| 国产成人在线观看| 九色综合国产一区二区三区| 一区二区三区视频在线看| 久久新电视剧免费观看| 日韩三级电影网址| 51午夜精品国产| 欧美视频精品在线| 欧美日韩国产一级| 欧美色电影在线| 精品久久久久久久久久久久久久久久久 | 337p粉嫩大胆色噜噜噜噜亚洲| 日本一不卡视频| 亚洲日本在线a| 久久伊人中文字幕| 国产成人在线影院| 美女尤物国产一区| 亚洲国产精品久久人人爱| 国产精品久久久久三级| 欧美一级二级三级乱码| 欧美男生操女生| 欧美日韩美女一区二区| 91麻豆精品国产91久久久更新时间| 欧美在线观看一区二区| 欧美性猛交一区二区三区精品| www.日韩大片| 在线观看欧美精品| 欧美一级片在线看| 国产视频亚洲色图| 亚洲日本va午夜在线影院| 亚洲午夜电影在线| 国内外成人在线| 91浏览器打开| 欧美一级精品大片| 精品国产乱码久久久久久夜甘婷婷| 欧美一区二区三区在线观看| 日韩欧美在线不卡| 中文字幕在线观看一区| 亚洲国产aⅴ成人精品无吗| 久久99国产精品久久99果冻传媒| 国产麻豆视频精品| 欧美综合久久久| 日韩一区二区不卡| 亚洲人妖av一区二区| 亚洲成人黄色小说| 国产丶欧美丶日本不卡视频| 欧美高清dvd| 亚洲精品乱码久久久久久久久| 日韩电影网1区2区| 一本大道久久a久久精品综合| 日韩精品一区二区三区三区免费 | 色综合久久九月婷婷色综合| 精品三级在线观看| 亚洲欧美日韩在线| 国产精品888| 国产日韩成人精品| 久久99精品久久久久久动态图 | 九九**精品视频免费播放| 欧美写真视频网站| 一区二区三区精品视频| 成人av网站在线| 国产精品素人视频| 国产麻豆一精品一av一免费| 欧美电视剧在线看免费| 日本亚洲免费观看| 欧美日韩国产bt| 污片在线观看一区二区| 欧美精品18+| 亚洲视频一区在线| 色香蕉久久蜜桃| 国产精品灌醉下药二区| 91在线视频免费91| 亚洲一区二区av在线| 日本道免费精品一区二区三区| 国产精品色哟哟| 91久久线看在观草草青青| 亚洲男人的天堂一区二区| 色狠狠一区二区三区香蕉| 日韩美女精品在线| 在线精品视频免费播放| 亚洲综合999| 日韩欧美国产一区在线观看| 久久99久久精品| 综合婷婷亚洲小说| 91精品国产欧美一区二区成人 | av不卡在线播放| 亚洲综合色网站| 久久综合狠狠综合久久激情| 色综合久久久久综合体桃花网| 伊人性伊人情综合网| 精品成a人在线观看| 成人av电影免费在线播放|