Java Code Examples for javax.imageio.spi.ImageReaderSpi#canDecodeInput()
The following examples show how to use
javax.imageio.spi.ImageReaderSpi#canDecodeInput() .
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: CanDecodeTest.java From dragonwell8_jdk with GNU General Public License v2.0 | 6 votes |
public void doTest(ImageReaderSpi spi) throws IOException { System.out.println("Test for " + title + (canDecode ? " (can decode)" : " (can't decode)")); System.out.print("As a stream..."); ImageInputStream iis = ImageIO.createImageInputStream(getDataStream()); if (spi.canDecodeInput(iis) != canDecode) { throw new RuntimeException("Test failed: wrong decideion " + "for stream data"); } System.out.println("OK"); System.out.print("As a file..."); iis = ImageIO.createImageInputStream(getDataFile()); if (spi.canDecodeInput(iis) != canDecode) { throw new RuntimeException("Test failed: wrong decideion " + "for file data"); } System.out.println("OK"); }
Example 2
Source File: CanDecodeTest.java From jdk8u_jdk with GNU General Public License v2.0 | 6 votes |
public void doTest(ImageReaderSpi spi) throws IOException { System.out.println("Test for " + title + (canDecode ? " (can decode)" : " (can't decode)")); System.out.print("As a stream..."); ImageInputStream iis = ImageIO.createImageInputStream(getDataStream()); if (spi.canDecodeInput(iis) != canDecode) { throw new RuntimeException("Test failed: wrong decideion " + "for stream data"); } System.out.println("OK"); System.out.print("As a file..."); iis = ImageIO.createImageInputStream(getDataFile()); if (spi.canDecodeInput(iis) != canDecode) { throw new RuntimeException("Test failed: wrong decideion " + "for file data"); } System.out.println("OK"); }
Example 3
Source File: CanDecodeTest.java From openjdk-8-source with GNU General Public License v2.0 | 6 votes |
public void doTest(ImageReaderSpi spi) throws IOException { System.out.println("Test for " + title + (canDecode ? " (can decode)" : " (can't decode)")); System.out.print("As a stream..."); ImageInputStream iis = ImageIO.createImageInputStream(getDataStream()); if (spi.canDecodeInput(iis) != canDecode) { throw new RuntimeException("Test failed: wrong decideion " + "for stream data"); } System.out.println("OK"); System.out.print("As a file..."); iis = ImageIO.createImageInputStream(getDataFile()); if (spi.canDecodeInput(iis) != canDecode) { throw new RuntimeException("Test failed: wrong decideion " + "for file data"); } System.out.println("OK"); }
Example 4
Source File: CanDecodeTest.java From hottub with GNU General Public License v2.0 | 6 votes |
public void doTest(ImageReaderSpi spi) throws IOException { System.out.println("Test for " + title + (canDecode ? " (can decode)" : " (can't decode)")); System.out.print("As a stream..."); ImageInputStream iis = ImageIO.createImageInputStream(getDataStream()); if (spi.canDecodeInput(iis) != canDecode) { throw new RuntimeException("Test failed: wrong decideion " + "for stream data"); } System.out.println("OK"); System.out.print("As a file..."); iis = ImageIO.createImageInputStream(getDataFile()); if (spi.canDecodeInput(iis) != canDecode) { throw new RuntimeException("Test failed: wrong decideion " + "for file data"); } System.out.println("OK"); }
Example 5
Source File: CanDecodeTest.java From jdk8u-jdk with GNU General Public License v2.0 | 6 votes |
public void doTest(ImageReaderSpi spi) throws IOException { System.out.println("Test for " + title + (canDecode ? " (can decode)" : " (can't decode)")); System.out.print("As a stream..."); ImageInputStream iis = ImageIO.createImageInputStream(getDataStream()); if (spi.canDecodeInput(iis) != canDecode) { throw new RuntimeException("Test failed: wrong decideion " + "for stream data"); } System.out.println("OK"); System.out.print("As a file..."); iis = ImageIO.createImageInputStream(getDataFile()); if (spi.canDecodeInput(iis) != canDecode) { throw new RuntimeException("Test failed: wrong decideion " + "for file data"); } System.out.println("OK"); }
Example 6
Source File: CanDecodeTest.java From jdk8u-jdk with GNU General Public License v2.0 | 6 votes |
public void doTest(ImageReaderSpi spi) throws IOException { System.out.println("Test for " + title + (canDecode ? " (can decode)" : " (can't decode)")); System.out.print("As a stream..."); ImageInputStream iis = ImageIO.createImageInputStream(getDataStream()); if (spi.canDecodeInput(iis) != canDecode) { throw new RuntimeException("Test failed: wrong decideion " + "for stream data"); } System.out.println("OK"); System.out.print("As a file..."); iis = ImageIO.createImageInputStream(getDataFile()); if (spi.canDecodeInput(iis) != canDecode) { throw new RuntimeException("Test failed: wrong decideion " + "for file data"); } System.out.println("OK"); }
Example 7
Source File: CanDecodeTest.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 6 votes |
public void doTest(ImageReaderSpi spi) throws IOException { System.out.println("Test for " + title + (canDecode ? " (can decode)" : " (can't decode)")); System.out.print("As a stream..."); ImageInputStream iis = ImageIO.createImageInputStream(getDataStream()); if (spi.canDecodeInput(iis) != canDecode) { throw new RuntimeException("Test failed: wrong decideion " + "for stream data"); } System.out.println("OK"); System.out.print("As a file..."); iis = ImageIO.createImageInputStream(getDataFile()); if (spi.canDecodeInput(iis) != canDecode) { throw new RuntimeException("Test failed: wrong decideion " + "for file data"); } System.out.println("OK"); }
Example 8
Source File: CanDecodeTest.java From openjdk-jdk8u with GNU General Public License v2.0 | 6 votes |
public void doTest(ImageReaderSpi spi) throws IOException { System.out.println("Test for " + title + (canDecode ? " (can decode)" : " (can't decode)")); System.out.print("As a stream..."); ImageInputStream iis = ImageIO.createImageInputStream(getDataStream()); if (spi.canDecodeInput(iis) != canDecode) { throw new RuntimeException("Test failed: wrong decideion " + "for stream data"); } System.out.println("OK"); System.out.print("As a file..."); iis = ImageIO.createImageInputStream(getDataFile()); if (spi.canDecodeInput(iis) != canDecode) { throw new RuntimeException("Test failed: wrong decideion " + "for file data"); } System.out.println("OK"); }
Example 9
Source File: CanDecodeTest.java From jdk8u60 with GNU General Public License v2.0 | 6 votes |
public void doTest(ImageReaderSpi spi) throws IOException { System.out.println("Test for " + title + (canDecode ? " (can decode)" : " (can't decode)")); System.out.print("As a stream..."); ImageInputStream iis = ImageIO.createImageInputStream(getDataStream()); if (spi.canDecodeInput(iis) != canDecode) { throw new RuntimeException("Test failed: wrong decideion " + "for stream data"); } System.out.println("OK"); System.out.print("As a file..."); iis = ImageIO.createImageInputStream(getDataFile()); if (spi.canDecodeInput(iis) != canDecode) { throw new RuntimeException("Test failed: wrong decideion " + "for file data"); } System.out.println("OK"); }
Example 10
Source File: CanDecodeTest.java From TencentKona-8 with GNU General Public License v2.0 | 6 votes |
public void doTest(ImageReaderSpi spi) throws IOException { System.out.println("Test for " + title + (canDecode ? " (can decode)" : " (can't decode)")); System.out.print("As a stream..."); ImageInputStream iis = ImageIO.createImageInputStream(getDataStream()); if (spi.canDecodeInput(iis) != canDecode) { throw new RuntimeException("Test failed: wrong decideion " + "for stream data"); } System.out.println("OK"); System.out.print("As a file..."); iis = ImageIO.createImageInputStream(getDataFile()); if (spi.canDecodeInput(iis) != canDecode) { throw new RuntimeException("Test failed: wrong decideion " + "for file data"); } System.out.println("OK"); }
Example 11
Source File: StreamResetTest.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 5 votes |
public static void main(String[] args) { IOException expectedException = null; TestStream iis = new TestStream(); ImageReader wbmp = ImageIO.getImageReadersByFormatName("WBMP").next(); if (wbmp == null) { System.out.println("No WBMP reader: skip the test"); return; } ImageReaderSpi spi = wbmp.getOriginatingProvider(); iis.checkPosition(); try { spi.canDecodeInput(iis); } catch (IOException e) { expectedException = e; } if (expectedException == null) { throw new RuntimeException("Test FAILED: stream was not used"); } iis.checkPosition(); System.out.println("Test PASSED"); }
Example 12
Source File: StreamResetTest.java From jdk8u-dev-jdk with GNU General Public License v2.0 | 5 votes |
public static void main(String[] args) { IOException expectedException = null; TestStream iis = new TestStream(); ImageReader wbmp = ImageIO.getImageReadersByFormatName("WBMP").next(); if (wbmp == null) { System.out.println("No WBMP reader: skip the test"); return; } ImageReaderSpi spi = wbmp.getOriginatingProvider(); iis.checkPosition(); try { spi.canDecodeInput(iis); } catch (IOException e) { expectedException = e; } if (expectedException == null) { throw new RuntimeException("Test FAILED: stream was not used"); } iis.checkPosition(); System.out.println("Test PASSED"); }
Example 13
Source File: StreamResetTest.java From openjdk-jdk9 with GNU General Public License v2.0 | 5 votes |
public static void main(String[] args) { IOException expectedException = null; TestStream iis = new TestStream(); ImageReader wbmp = ImageIO.getImageReadersByFormatName("WBMP").next(); if (wbmp == null) { System.out.println("No WBMP reader: skip the test"); return; } ImageReaderSpi spi = wbmp.getOriginatingProvider(); iis.checkPosition(); try { spi.canDecodeInput(iis); } catch (IOException e) { expectedException = e; } if (expectedException == null) { throw new RuntimeException("Test FAILED: stream was not used"); } iis.checkPosition(); System.out.println("Test PASSED"); }
Example 14
Source File: StreamResetTest.java From jdk8u_jdk with GNU General Public License v2.0 | 5 votes |
public static void main(String[] args) { IOException expectedException = null; TestStream iis = new TestStream(); ImageReader wbmp = ImageIO.getImageReadersByFormatName("WBMP").next(); if (wbmp == null) { System.out.println("No WBMP reader: skip the test"); return; } ImageReaderSpi spi = wbmp.getOriginatingProvider(); iis.checkPosition(); try { spi.canDecodeInput(iis); } catch (IOException e) { expectedException = e; } if (expectedException == null) { throw new RuntimeException("Test FAILED: stream was not used"); } iis.checkPosition(); System.out.println("Test PASSED"); }
Example 15
Source File: StreamResetTest.java From jdk8u60 with GNU General Public License v2.0 | 5 votes |
public static void main(String[] args) { IOException expectedException = null; TestStream iis = new TestStream(); ImageReader wbmp = ImageIO.getImageReadersByFormatName("WBMP").next(); if (wbmp == null) { System.out.println("No WBMP reader: skip the test"); return; } ImageReaderSpi spi = wbmp.getOriginatingProvider(); iis.checkPosition(); try { spi.canDecodeInput(iis); } catch (IOException e) { expectedException = e; } if (expectedException == null) { throw new RuntimeException("Test FAILED: stream was not used"); } iis.checkPosition(); System.out.println("Test PASSED"); }
Example 16
Source File: StreamResetTest.java From hottub with GNU General Public License v2.0 | 5 votes |
public static void main(String[] args) { IOException expectedException = null; TestStream iis = new TestStream(); ImageReader wbmp = ImageIO.getImageReadersByFormatName("WBMP").next(); if (wbmp == null) { System.out.println("No WBMP reader: skip the test"); return; } ImageReaderSpi spi = wbmp.getOriginatingProvider(); iis.checkPosition(); try { spi.canDecodeInput(iis); } catch (IOException e) { expectedException = e; } if (expectedException == null) { throw new RuntimeException("Test FAILED: stream was not used"); } iis.checkPosition(); System.out.println("Test PASSED"); }
Example 17
Source File: StreamResetTest.java From openjdk-8-source with GNU General Public License v2.0 | 5 votes |
public static void main(String[] args) { IOException expectedException = null; TestStream iis = new TestStream(); ImageReader wbmp = ImageIO.getImageReadersByFormatName("WBMP").next(); if (wbmp == null) { System.out.println("No WBMP reader: skip the test"); return; } ImageReaderSpi spi = wbmp.getOriginatingProvider(); iis.checkPosition(); try { spi.canDecodeInput(iis); } catch (IOException e) { expectedException = e; } if (expectedException == null) { throw new RuntimeException("Test FAILED: stream was not used"); } iis.checkPosition(); System.out.println("Test PASSED"); }
Example 18
Source File: StreamResetTest.java From TencentKona-8 with GNU General Public License v2.0 | 5 votes |
public static void main(String[] args) { IOException expectedException = null; TestStream iis = new TestStream(); ImageReader wbmp = ImageIO.getImageReadersByFormatName("WBMP").next(); if (wbmp == null) { System.out.println("No WBMP reader: skip the test"); return; } ImageReaderSpi spi = wbmp.getOriginatingProvider(); iis.checkPosition(); try { spi.canDecodeInput(iis); } catch (IOException e) { expectedException = e; } if (expectedException == null) { throw new RuntimeException("Test FAILED: stream was not used"); } iis.checkPosition(); System.out.println("Test PASSED"); }
Example 19
Source File: StreamResetTest.java From openjdk-8 with GNU General Public License v2.0 | 5 votes |
public static void main(String[] args) { IOException expectedException = null; TestStream iis = new TestStream(); ImageReader wbmp = ImageIO.getImageReadersByFormatName("WBMP").next(); if (wbmp == null) { System.out.println("No WBMP reader: skip the test"); return; } ImageReaderSpi spi = wbmp.getOriginatingProvider(); iis.checkPosition(); try { spi.canDecodeInput(iis); } catch (IOException e) { expectedException = e; } if (expectedException == null) { throw new RuntimeException("Test FAILED: stream was not used"); } iis.checkPosition(); System.out.println("Test PASSED"); }
Example 20
Source File: StreamResetTest.java From dragonwell8_jdk with GNU General Public License v2.0 | 5 votes |
public static void main(String[] args) { IOException expectedException = null; TestStream iis = new TestStream(); ImageReader wbmp = ImageIO.getImageReadersByFormatName("WBMP").next(); if (wbmp == null) { System.out.println("No WBMP reader: skip the test"); return; } ImageReaderSpi spi = wbmp.getOriginatingProvider(); iis.checkPosition(); try { spi.canDecodeInput(iis); } catch (IOException e) { expectedException = e; } if (expectedException == null) { throw new RuntimeException("Test FAILED: stream was not used"); } iis.checkPosition(); System.out.println("Test PASSED"); }