Java Code Examples for javax.imageio.ImageReader#addIIOReadWarningListener()
The following examples show how to use
javax.imageio.ImageReader#addIIOReadWarningListener() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: TruncatedImageWarningTest.java From dragonwell8_jdk with GNU General Public License v2.0 | 6 votes |
public static void main(String[] args) throws IOException { String sep = System.getProperty("file.separator"); String dir = System.getProperty("test.src", "."); String filePath = dir+sep+fileName; System.out.println("Test file: " + filePath); File f = new File(filePath); ImageInputStream in = ImageIO.createImageInputStream(f); ImageReader reader = ImageIO.getImageReaders(in).next(); TruncatedImageWarningTest twt = new TruncatedImageWarningTest(); reader.addIIOReadWarningListener(twt); reader.setInput(in); reader.read(0); if (!twt.receivedWarning) { throw new RuntimeException("No expected warning"); } }
Example 2
Source File: TruncatedImageWarningTest.java From TencentKona-8 with GNU General Public License v2.0 | 6 votes |
public static void main(String[] args) throws IOException { String sep = System.getProperty("file.separator"); String dir = System.getProperty("test.src", "."); String filePath = dir+sep+fileName; System.out.println("Test file: " + filePath); File f = new File(filePath); ImageInputStream in = ImageIO.createImageInputStream(f); ImageReader reader = ImageIO.getImageReaders(in).next(); TruncatedImageWarningTest twt = new TruncatedImageWarningTest(); reader.addIIOReadWarningListener(twt); reader.setInput(in); reader.read(0); if (!twt.receivedWarning) { throw new RuntimeException("No expected warning"); } }
Example 3
Source File: TruncatedImageWarningTest.java From jdk8u60 with GNU General Public License v2.0 | 6 votes |
public static void main(String[] args) throws IOException { String sep = System.getProperty("file.separator"); String dir = System.getProperty("test.src", "."); String filePath = dir+sep+fileName; System.out.println("Test file: " + filePath); File f = new File(filePath); ImageInputStream in = ImageIO.createImageInputStream(f); ImageReader reader = ImageIO.getImageReaders(in).next(); TruncatedImageWarningTest twt = new TruncatedImageWarningTest(); reader.addIIOReadWarningListener(twt); reader.setInput(in); reader.read(0); if (!twt.receivedWarning) { throw new RuntimeException("No expected warning"); } }
Example 4
Source File: TruncatedImageWarningTest.java From openjdk-jdk8u with GNU General Public License v2.0 | 6 votes |
public static void main(String[] args) throws IOException { String sep = System.getProperty("file.separator"); String dir = System.getProperty("test.src", "."); String filePath = dir+sep+fileName; System.out.println("Test file: " + filePath); File f = new File(filePath); ImageInputStream in = ImageIO.createImageInputStream(f); ImageReader reader = ImageIO.getImageReaders(in).next(); TruncatedImageWarningTest twt = new TruncatedImageWarningTest(); reader.addIIOReadWarningListener(twt); reader.setInput(in); reader.read(0); if (!twt.receivedWarning) { throw new RuntimeException("No expected warning"); } }
Example 5
Source File: TruncatedImageWarningTest.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 6 votes |
public static void main(String[] args) throws IOException { String sep = System.getProperty("file.separator"); String dir = System.getProperty("test.src", "."); String filePath = dir+sep+fileName; System.out.println("Test file: " + filePath); File f = new File(filePath); ImageInputStream in = ImageIO.createImageInputStream(f); ImageReader reader = ImageIO.getImageReaders(in).next(); TruncatedImageWarningTest twt = new TruncatedImageWarningTest(); reader.addIIOReadWarningListener(twt); reader.setInput(in); reader.read(0); if (!twt.receivedWarning) { throw new RuntimeException("No expected warning"); } }
Example 6
Source File: TruncatedImageWarningTest.java From openjdk-jdk9 with GNU General Public License v2.0 | 6 votes |
public static void main(String[] args) throws IOException { String sep = System.getProperty("file.separator"); String dir = System.getProperty("test.src", "."); String filePath = dir+sep+fileName; System.out.println("Test file: " + filePath); File f = new File(filePath); ImageInputStream in = ImageIO.createImageInputStream(f); ImageReader reader = ImageIO.getImageReaders(in).next(); TruncatedImageWarningTest twt = new TruncatedImageWarningTest(); reader.addIIOReadWarningListener(twt); reader.setInput(in); reader.read(0); if (!twt.receivedWarning) { throw new RuntimeException("No expected warning"); } }
Example 7
Source File: TruncatedImageWarningTest.java From jdk8u-jdk with GNU General Public License v2.0 | 6 votes |
public static void main(String[] args) throws IOException { String sep = System.getProperty("file.separator"); String dir = System.getProperty("test.src", "."); String filePath = dir+sep+fileName; System.out.println("Test file: " + filePath); File f = new File(filePath); ImageInputStream in = ImageIO.createImageInputStream(f); ImageReader reader = ImageIO.getImageReaders(in).next(); TruncatedImageWarningTest twt = new TruncatedImageWarningTest(); reader.addIIOReadWarningListener(twt); reader.setInput(in); reader.read(0); if (!twt.receivedWarning) { throw new RuntimeException("No expected warning"); } }
Example 8
Source File: TruncatedImageWarningTest.java From hottub with GNU General Public License v2.0 | 6 votes |
public static void main(String[] args) throws IOException { String sep = System.getProperty("file.separator"); String dir = System.getProperty("test.src", "."); String filePath = dir+sep+fileName; System.out.println("Test file: " + filePath); File f = new File(filePath); ImageInputStream in = ImageIO.createImageInputStream(f); ImageReader reader = ImageIO.getImageReaders(in).next(); TruncatedImageWarningTest twt = new TruncatedImageWarningTest(); reader.addIIOReadWarningListener(twt); reader.setInput(in); reader.read(0); if (!twt.receivedWarning) { throw new RuntimeException("No expected warning"); } }
Example 9
Source File: TruncatedImageWarningTest.java From jdk8u_jdk with GNU General Public License v2.0 | 6 votes |
public static void main(String[] args) throws IOException { String sep = System.getProperty("file.separator"); String dir = System.getProperty("test.src", "."); String filePath = dir+sep+fileName; System.out.println("Test file: " + filePath); File f = new File(filePath); ImageInputStream in = ImageIO.createImageInputStream(f); ImageReader reader = ImageIO.getImageReaders(in).next(); TruncatedImageWarningTest twt = new TruncatedImageWarningTest(); reader.addIIOReadWarningListener(twt); reader.setInput(in); reader.read(0); if (!twt.receivedWarning) { throw new RuntimeException("No expected warning"); } }
Example 10
Source File: TruncatedImageWarningTest.java From jdk8u-jdk with GNU General Public License v2.0 | 6 votes |
public static void main(String[] args) throws IOException { String sep = System.getProperty("file.separator"); String dir = System.getProperty("test.src", "."); String filePath = dir+sep+fileName; System.out.println("Test file: " + filePath); File f = new File(filePath); ImageInputStream in = ImageIO.createImageInputStream(f); ImageReader reader = ImageIO.getImageReaders(in).next(); TruncatedImageWarningTest twt = new TruncatedImageWarningTest(); reader.addIIOReadWarningListener(twt); reader.setInput(in); reader.read(0); if (!twt.receivedWarning) { throw new RuntimeException("No expected warning"); } }
Example 11
Source File: TruncatedImageWarningTest.java From jdk8u-dev-jdk with GNU General Public License v2.0 | 6 votes |
public static void main(String[] args) throws IOException { String sep = System.getProperty("file.separator"); String dir = System.getProperty("test.src", "."); String filePath = dir+sep+fileName; System.out.println("Test file: " + filePath); File f = new File(filePath); ImageInputStream in = ImageIO.createImageInputStream(f); ImageReader reader = ImageIO.getImageReaders(in).next(); TruncatedImageWarningTest twt = new TruncatedImageWarningTest(); reader.addIIOReadWarningListener(twt); reader.setInput(in); reader.read(0); if (!twt.receivedWarning) { throw new RuntimeException("No expected warning"); } }
Example 12
Source File: DestTypeTest.java From openjdk-jdk9 with GNU General Public License v2.0 | 5 votes |
public DestTypeTest() { w = (ImageWriter) ImageIO.getImageWritersByFormatName("jpeg").next(); w.addIIOWriteWarningListener(this); r = (ImageReader) ImageIO.getImageReadersByFormatName("jpeg").next(); r.addIIOReadWarningListener(this); }
Example 13
Source File: DestTypeTest.java From jdk8u_jdk with GNU General Public License v2.0 | 5 votes |
public DestTypeTest() { w = (ImageWriter) ImageIO.getImageWritersByFormatName("jpeg").next(); w.addIIOWriteWarningListener(this); r = (ImageReader) ImageIO.getImageReadersByFormatName("jpeg").next(); r.addIIOReadWarningListener(this); }