예제 #1
0
    /**
     * write the blocks to a stream
     *
     * @param stream the stream to which the data is to be written
     */
    void writeBlocks(OutputStream stream) throws IOException {
      if (isValid()) {
        if (_writer != null) {
          DocumentOutputStream dstream = new DocumentOutputStream(stream, _size);

          _writer.processPOIFSWriterEvent(new POIFSWriterEvent(dstream, _path, _name, _size));
          dstream.writeFiller(
              countBlocks() * _bigBlockSize.getBigBlockSize(), DocumentBlock.getFillByte());
        } else {
          for (int k = 0; k < bigBlocks.length; k++) {
            bigBlocks[k].writeBlocks(stream);
          }
        }
      }
    }