throws IOException {
if (input instanceof InputStream) {
InputStream is = (InputStream)input;
if (useCache) {
return new FileCacheImageInputStream(is, cacheDir);
} else {
return new MemoryCacheImageInputStream(is);
}
} else {
throw new IllegalArgumentException();