simtools.util
Class ImageSerializer

java.lang.Object
  extended by simtools.util.ImageSerializer

public class ImageSerializer
extends java.lang.Object

This class contains static utilities for reading and writing images to object streams during serialization.


Constructor Summary
ImageSerializer()
           
 
Method Summary
static void main(java.lang.String[] args)
           
static java.awt.image.BufferedImage read(java.io.ObjectInputStream in)
          Reads an image from an output stream.
static void write(java.io.ObjectOutputStream out, java.awt.image.BufferedImage img)
          Writes an image into an output stream The image will be saved using the lossless compression png format if available, or the jpeg one will be tried too.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ImageSerializer

public ImageSerializer()
Method Detail

write

public static void write(java.io.ObjectOutputStream out,
                         java.awt.image.BufferedImage img)
                  throws java.io.IOException
Writes an image into an output stream The image will be saved using the lossless compression png format if available, or the jpeg one will be tried too.

Throws:
java.io.IOException

read

public static java.awt.image.BufferedImage read(java.io.ObjectInputStream in)
                                         throws java.lang.ClassNotFoundException,
                                                java.io.IOException
Reads an image from an output stream. The image should have be written by the corresponding write method in this class, or it must be a whole file of a known image type.

Throws:
java.lang.ClassNotFoundException
java.io.IOException

main

public static void main(java.lang.String[] args)