本文整理匯總了Java中javax.imageio.spi.ImageReaderSpi.getNativeStreamMetadataFormatName方法的典型用法代碼示例。如果您正苦於以下問題:Java ImageReaderSpi.getNativeStreamMetadataFormatName方法的具體用法?Java ImageReaderSpi.getNativeStreamMetadataFormatName怎麽用?Java ImageReaderSpi.getNativeStreamMetadataFormatName使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類javax.imageio.spi.ImageReaderSpi
的用法示例。
在下文中一共展示了ImageReaderSpi.getNativeStreamMetadataFormatName方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: main
import javax.imageio.spi.ImageReaderSpi; //導入方法依賴的package包/類
public static void main(String[] args) {
ImageReaderSpi rspi = new PNGImageReaderSpi();
if (rspi.getNativeStreamMetadataFormatName() != null) {
fatal();
}
if (rspi.isStandardStreamMetadataFormatSupported() != false) {
fatal();
}
if (rspi.getExtraStreamMetadataFormatNames() != null) {
fatal();
}
ImageWriterSpi wspi = new PNGImageWriterSpi();
if (wspi.getNativeStreamMetadataFormatName() != null) {
fatal();
}
if (wspi.isStandardStreamMetadataFormatSupported() != false) {
fatal();
}
if (wspi.getExtraStreamMetadataFormatNames() != null) {
fatal();
}
}
示例2: filter
import javax.imageio.spi.ImageReaderSpi; //導入方法依賴的package包/類
public boolean filter(Object provider) {
ImageReaderSpi readerSPI = (ImageReaderSpi)provider;
if(readerSPI != null) {
String streamMetadataName =
readerSPI.getNativeStreamMetadataFormatName();
if(streamMetadataName != null) {
return streamMetadataName.equals(STREAM_METADATA_NAME);
} else {
return false;
}
}
return false;
}
示例3: main
import javax.imageio.spi.ImageReaderSpi; //導入方法依賴的package包/類
public static void main(String[] args) {
fmts = new Hashtable();
fmts.put("javax_imageio_jpeg_stream_1.0", Boolean.FALSE);
fmts.put("javax_imageio_jpeg_image_1.0", Boolean.FALSE);
fmts.put("javax_imageio_png_1.0", Boolean.FALSE);
fmts.put("javax_imageio_bmp_1.0", Boolean.FALSE);
fmts.put("javax_imageio_wbmp_1.0", Boolean.FALSE);
fmts.put("javax_imageio_gif_stream_1.0", Boolean.FALSE);
fmts.put("javax_imageio_gif_image_1.0", Boolean.FALSE);
IIORegistry registry = IIORegistry.getDefaultInstance();
Iterator iter = registry.getServiceProviders(ImageReaderSpi.class,
false);
while(iter.hasNext()) {
ImageReaderSpi spi = (ImageReaderSpi)iter.next();
String fmt_name;
fmt_name = spi.getNativeStreamMetadataFormatName();
testStreamMetadataFormat(spi, fmt_name);
fmt_name = spi.getNativeImageMetadataFormatName();
testImageMetadataFormat(spi, fmt_name);
String[] fmt_names;
fmt_names = spi.getExtraStreamMetadataFormatNames();
for (int i=0; fmt_names != null && i < fmt_names.length; i++) {
testStreamMetadataFormat(spi, fmt_names[i]);
}
fmt_names = spi.getExtraImageMetadataFormatNames();
for (int i=0; fmt_names != null && i < fmt_names.length; i++) {
testImageMetadataFormat(spi, fmt_names[i]);
}
}
Enumeration keys = fmts.keys();
while (keys.hasMoreElements()) {
String key = (String)keys.nextElement();
boolean val = ((Boolean)fmts.get(key)).booleanValue();
if (!val) {
throw new RuntimeException("Test failed: format " +
key + "is not registered.");
}
}
}