Class OutputStreamImageSink

  • All Implemented Interfaces:
    ImageSink<java.io.OutputStream>

    public class OutputStreamImageSink
    extends AbstractImageSink<java.io.OutputStream>
    An ImageSink which specifies an OutputStream to which the thumbnail image should be written to.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.io.OutputStream os
      The OutputStream to which the thumbnail image is to be written to.
    • Constructor Summary

      Constructors 
      Constructor Description
      OutputStreamImageSink​(java.io.OutputStream os)
      Instantiates an OutputStreamImageSink with the OutputStream to which the thumbnail should be written to.
    • Field Detail

      • os

        private final java.io.OutputStream os
        The OutputStream to which the thumbnail image is to be written to.
    • Constructor Detail

      • OutputStreamImageSink

        public OutputStreamImageSink​(java.io.OutputStream os)
        Instantiates an OutputStreamImageSink with the OutputStream to which the thumbnail should be written to.
        Parameters:
        os - The OutputStream to write the thumbnail to.
        Throws:
        java.lang.NullPointerException - If the OutputStream is null.
    • Method Detail

      • setCompressionModeExplicit

        private void setCompressionModeExplicit​(javax.imageio.ImageWriteParam writeParam)
        Sets the compression mode to explicit, if not already. A check exists to prevent setting the explicit mode more than once, as any previously set parameters will be discarded.
        Parameters:
        writeParam - Current image writer parameters.
      • isJpegOrBmp

        private boolean isJpegOrBmp​(java.lang.String formatName)
      • isPng

        private boolean isPng​(java.lang.String formatName)
      • isDefaultPngWriter

        private boolean isDefaultPngWriter​(javax.imageio.ImageWriter writer)
      • isJava9OrNewer

        private boolean isJava9OrNewer()
      • getSink

        public java.io.OutputStream getSink()
        Description copied from interface: ImageSink
        Returns the destination to which the thumbnail will be stored or written.
        Returns:
        The destination for the thumbnail image.