Documentation of 'org.apache.poi.poifs.storage.DocumentBlock' Java class
DocumentBlock
org.apache.poi.poifs.storage

Class DocumentBlock

  • All Implemented Interfaces:
    BlockWritable


    public final class DocumentBlock
    extends java.lang.Object
    A block of document data.
    • Constructor Detail

      • DocumentBlock

        public DocumentBlock(RawDataBlock block)
                      throws java.io.IOException
        create a document block from a raw data block
        Parameters:
        block - the raw data block
        Throws:
        java.io.IOException
      • DocumentBlock

        public DocumentBlock(java.io.InputStream stream,
                             POIFSBigBlockSize bigBlockSize)
                      throws java.io.IOException
        Create a single instance initialized with data.
        Parameters:
        stream - the InputStream delivering the data.
        Throws:
        java.io.IOException
    • Method Detail

      • size

        public int size()
        Get the number of bytes read for this block
        Returns:
        bytes read into the block
      • partiallyRead

        public boolean partiallyRead()
        Was this a partially read block?
        Returns:
        true if the block was only partially filled with data
      • getFillByte

        public static byte getFillByte()
        Returns:
        the fill byte used
      • convert

        public static DocumentBlock[] convert(POIFSBigBlockSize bigBlockSize,
                                              byte[] array,
                                              int size)
        convert a single long array into an array of DocumentBlock instances
        Parameters:
        array - the byte array to be converted
        size - the intended size of the array (which may be smaller)
        Returns:
        an array of DocumentBlock instances, filled from the input array
      • writeBlocks

        public void writeBlocks(java.io.OutputStream stream)
                         throws java.io.IOException
        Write the storage to an OutputStream
        Specified by:
        writeBlocks in interface BlockWritable
        Parameters:
        stream - the OutputStream to which the stored data should be written
        Throws:
        java.io.IOException - on problems writing to the specified stream

DataMelt 3.0 © DataMelt by jWork.ORG

Ads help maintain this website.