Package javax.imageio

Examples of javax.imageio.ImageWriter.dispose()


    // write the image
    writer.write(null, new IIOImage(bi, null, null), param);

    // cleanup
    ios.flush();
    writer.dispose();
    ios.close();   
  }
 
  /**
   * for testing only.
View Full Code Here


        p.setCompressionQuality(this.quality);
        ImageOutputStream ios = ImageIO.createImageOutputStream(outputStream);
        writer.setOutput(ios);
        writer.write(null, new IIOImage(bufferedImage, null, null), p);
        ios.flush();
        writer.dispose();
        ios.close();
    }

}
View Full Code Here

            // accept a driver that can't, if a better one can't be found
            while (writers.hasNext())
            {
                if (writer != null)
                {
                    writer.dispose();
                }
                writer = writers.next();
                param = writer.getDefaultWriteParam();
                metadata = writer.getDefaultImageMetadata(new ImageTypeSpecifier(image), param);
                if (metadata != null
View Full Code Here

        }
        finally
        {
            if (writer != null)
            {
                writer.dispose();
            }
            if (imageOutput != null)
            {
                imageOutput.close();
            }
View Full Code Here

                }
                finally
                {
                    if( imageWriter != null )
                    {
                        imageWriter.dispose();
                    }
                }
            }
            if( !foundWriter )
            {
View Full Code Here

            }
            if (writer != null) {
                ImageOutputStream stream = ImageIO.createImageOutputStream(os);
                writer.setOutput(stream);
                writer.write(bufImage);
                writer.dispose();
                stream.close();
            } else {
                throw new IOException("Unsupported mime type:"+ type);
            }
        } catch (Exception e) {
View Full Code Here

    // write the image
    writer.write(null, new IIOImage(bi, null, null), param);

    // cleanup
    ios.flush();
    writer.dispose();
    ios.close();   
  }
 
  /**
   * for testing only.
View Full Code Here

            }
            FileImageOutputStream thumbOut =
              new FileImageOutputStream(thumbFile);
            thumbWriter.setOutput(thumbOut);
            thumbWriter.write(null, new IIOImage(thumb, null, null), iwp);
            thumbWriter.dispose();
            thumbOut.close();
           
        } catch (IOException ex) {
            return false;
        }
View Full Code Here

               
                BufferedImage bimg = convertToBufferedImage((Image)obj);
                ImageOutputStream out = ImageIO.createImageOutputStream(os);
                writer.setOutput(out);
                writer.write(bimg);
                writer.dispose();
                out.flush();
                out.close();
                return;
            }
        } else if (obj instanceof byte[]) {
View Full Code Here

            throw new SimpleImageException(e);
        } finally {
            ImageUtils.closeQuietly(imageOut);

            if (writer != null) {
                writer.dispose();
            }
        }
    }
}
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.