src/share/classes/com/sun/imageio/spi/InputStreamImageInputStreamSpi.java

Print this page
rev 9343 : 8033716: Fix raw and unchecked lint warnings in com.sun.imageio
Reviewed-by: darcy, prr, bae


  23  * questions.
  24  */
  25 
  26 package com.sun.imageio.spi;
  27 
  28 import java.io.File;
  29 import java.io.InputStream;
  30 import java.io.IOException;
  31 import java.util.Locale;
  32 import javax.imageio.spi.ImageInputStreamSpi;
  33 import javax.imageio.stream.ImageInputStream;
  34 import javax.imageio.stream.FileCacheImageInputStream;
  35 import javax.imageio.stream.MemoryCacheImageInputStream;
  36 
  37 public class InputStreamImageInputStreamSpi extends ImageInputStreamSpi {
  38 
  39     private static final String vendorName = "Oracle Corporation";
  40 
  41     private static final String version = "1.0";
  42 
  43     private static final Class inputClass = InputStream.class;
  44 
  45     public InputStreamImageInputStreamSpi() {
  46         super(vendorName, version, inputClass);
  47     }
  48 
  49     public String getDescription(Locale locale) {
  50         return "Service provider that instantiates a FileCacheImageInputStream or MemoryCacheImageInputStream from an InputStream";
  51     }
  52 
  53     public boolean canUseCacheFile() {
  54         return true;
  55     }
  56 
  57     public boolean needsCacheFile() {
  58         return false;
  59     }
  60 
  61     public ImageInputStream createInputStreamInstance(Object input,
  62                                                       boolean useCache,
  63                                                       File cacheDir)


  23  * questions.
  24  */
  25 
  26 package com.sun.imageio.spi;
  27 
  28 import java.io.File;
  29 import java.io.InputStream;
  30 import java.io.IOException;
  31 import java.util.Locale;
  32 import javax.imageio.spi.ImageInputStreamSpi;
  33 import javax.imageio.stream.ImageInputStream;
  34 import javax.imageio.stream.FileCacheImageInputStream;
  35 import javax.imageio.stream.MemoryCacheImageInputStream;
  36 
  37 public class InputStreamImageInputStreamSpi extends ImageInputStreamSpi {
  38 
  39     private static final String vendorName = "Oracle Corporation";
  40 
  41     private static final String version = "1.0";
  42 
  43     private static final Class<?> inputClass = InputStream.class;
  44 
  45     public InputStreamImageInputStreamSpi() {
  46         super(vendorName, version, inputClass);
  47     }
  48 
  49     public String getDescription(Locale locale) {
  50         return "Service provider that instantiates a FileCacheImageInputStream or MemoryCacheImageInputStream from an InputStream";
  51     }
  52 
  53     public boolean canUseCacheFile() {
  54         return true;
  55     }
  56 
  57     public boolean needsCacheFile() {
  58         return false;
  59     }
  60 
  61     public ImageInputStream createInputStreamInstance(Object input,
  62                                                       boolean useCache,
  63                                                       File cacheDir)