Class FileFormatWriter

  • All Implemented Interfaces:
    FileFormatBoxes

    public class FileFormatWriter
    extends Object
    implements FileFormatBoxes
    This class writes the file format wrapper that may or may not exist around a valid JPEG 2000 codestream. This class writes the simple possible legal fileformat
    See Also:
    FileFormatReader
    • Constructor Detail

      • FileFormatWriter

        public FileFormatWriter​(File file,
                                ImageOutputStream stream,
                                int height,
                                int width,
                                int nc,
                                int[] bpc,
                                int clength,
                                ColorModel colorModel,
                                SampleModel sampleModel,
                                J2KMetadata metadata)
        The constructor of the FileFormatWriter. It receives all the information necessary about a codestream to generate a legal JP2 file
        Parameters:
        file - The name of the file that is to be made a JP2 file
        height - The height of the image
        width - The width of the image
        nc - The number of components
        bpc - The number of bits per component
        clength - Length of codestream
        colorModel - The color model of the image to be compressed.
    • Method Detail

      • writeFileFormat

        public int writeFileFormat()
                            throws IOException
        This method reads the codestream and writes the file format wrapper and the codestream to the same file
        Returns:
        The number of bytes increases because of the file format
        Throws:
        IOException - If an I/O error ocurred.
      • writeContiguousCodeStreamBox

        public void writeContiguousCodeStreamBox()
                                          throws IOException
        This method writes the Contiguous codestream box
        Throws:
        IOException - If an I/O error ocurred.