下面列出了javax.imageio.spi.ImageReaderSpi#canDecodeInput ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。
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");
}
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");
}
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");
}
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");
}
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");
}
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");
}
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");
}
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");
}
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");
}
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");
}
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");
}
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");
}
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");
}
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");
}
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");
}
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");
}
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");
}
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");
}
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");
}
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");
}