Class HSLFPictureData

    • Method Detail

      • setSignature

        public abstract void setSignature​(int signature)
      • getOffset

        public int getOffset()
        File offset in the 'Pictures' stream
        Returns:
        offset in the 'Pictures' stream
      • setOffset

        @Deprecated
        @Removal(version="5.3")
        public void setOffset​(int offset)
        Deprecated.
        This function was only intended for POI internal use. If you have a use case you're concerned about, please open an issue in the POI issue tracker.
        Set offset of this picture in the 'Pictures' stream. We need to set it when a new picture is created.
        Parameters:
        offset - in the 'Pictures' stream
      • getUID

        public byte[] getUID()
        Returns 16-byte checksum of this picture
      • getChecksum

        public byte[] getChecksum()
        Description copied from interface: PictureData
        Gets the checksum - the checksum can be of various length - mostly it's 8 (XSLF) or 16 (HSLF) bytes long.
        Specified by:
        getChecksum in interface PictureData
        Returns:
        the checksum
      • getChecksum

        public static byte[] getChecksum​(byte[] data)
        Compute 16-byte checksum of this picture using MD5 algorithm.
      • write

        public void write​(java.io.OutputStream out)
                   throws java.io.IOException
        Write this picture into OutputStream
        Throws:
        java.io.IOException
      • getHeader

        public byte[] getHeader()
        Return 24 byte header which preceeds the actual picture data.

        The header consists of 2-byte signature, 2-byte type, 4-byte image size and 16-byte checksum of the image data.

        Returns:
        the 24 byte header which preceeds the actual picture data.
      • getIndex

        public int getIndex()
        Returns the 1-based index of this picture.
        Returns:
        the 1-based index of this pictures within the pictures stream
      • setIndex

        public void setIndex​(int index)
        Parameters:
        index - sets the 1-based index of this pictures within the pictures stream
      • setData

        public final void setData​(byte[] data)
                           throws java.io.IOException
        Description copied from interface: PictureData
        Sets the binary picture data

        The format of the data must match the format of PictureData.getType(). Failure to match the picture data may result in data loss.

        Specified by:
        setData in interface PictureData
        Parameters:
        data - picture data
        Throws:
        java.io.IOException
      • getContentType

        public final java.lang.String getContentType()
        Description copied from interface: PictureData
        Returns content type (mime type) of this picture.
        Specified by:
        getContentType in interface PictureData
        Returns:
        content type of this picture.
      • getGenericProperties

        public java.util.Map<java.lang.String,​java.util.function.Supplier<?>> getGenericProperties()
        Specified by:
        getGenericProperties in interface GenericRecord