FileDocCategorySizeDatePackage
TruncatedFileException.javaAPI DocJava SE 6 API2973Tue Jun 10 00:21:50 BST 2008com.sun.image.codec.jpeg

TruncatedFileException

public class TruncatedFileException extends RuntimeException
Signals that a truncated file was detected. This object contains the Raster/BufferedImage that has the partially decoded image data in it. There is no indication of the portion of the Raster that may or may not be good.

Note that the classes in the com.sun.image.codec.jpeg package are not part of the core Java APIs. They are a part of Sun's JDK and JRE distributions. Although other licensees may choose to distribute these classes, developers cannot depend on their availability in non-Sun implementations. We expect that equivalent functionality will eventually be available in a core API or standard extension.

author
Thomas DeWeese
see
JPEGImageDecoder
since
1.2

Fields Summary
private Raster
ras
private BufferedImage
bi
Constructors Summary
public TruncatedFileException(BufferedImage bi)
Constructs a TruncatedFileException with the partially decoded BufferedImage.

param
bi the partially decoded BufferedImage (may be null).
since
1.2



                                
       
		super("Premature end of input file");
		this.bi  = bi;
		this.ras = bi.getData();
    
public TruncatedFileException(Raster ras)
Constructs an TruncatedFileException with the partially decoded Raster

param
ras the partially decoded Raster (may be null).
since
1.2

		super("Premature end of input file");
		this.ras = ras;
    
Methods Summary
public java.awt.image.BufferedImagegetBufferedImage()
Allows access to the BufferedImage that was in the progress of being decoded, this may be null, it is likely to be only partially filled with image data.

since
1.2

 return bi; 
public java.awt.image.RastergetRaster()
Allows access to the raster that was in the progress of being decoded may be null, it is likely to be only partially filled with image data.

since
1.2

 return ras;