01: /*
02: * Licensed to the Apache Software Foundation (ASF) under one or more
03: * contributor license agreements. See the NOTICE file distributed with
04: * this work for additional information regarding copyright ownership.
05: * The ASF licenses this file to You under the Apache License, Version 2.0
06: * (the "License"); you may not use this file except in compliance with
07: * the License. You may obtain a copy of the License at
08: *
09: * http://www.apache.org/licenses/LICENSE-2.0
10: *
11: * Unless required by applicable law or agreed to in writing, software
12: * distributed under the License is distributed on an "AS IS" BASIS,
13: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14: * See the License for the specific language governing permissions and
15: * limitations under the License.
16: */
17: /**
18: * @author Rustem V. Rafikov
19: * @version $Revision: 1.3 $
20: */package javax.imageio.spi;
21:
22: import java.io.File;
23: import java.io.IOException;
24: import javax.imageio.stream.ImageInputStream;
25:
26: import org.apache.harmony.luni.util.NotImplementedException;
27:
28: public abstract class ImageInputStreamSpi extends IIOServiceProvider
29: implements RegisterableService {
30: protected Class<?> inputClass;
31:
32: protected ImageInputStreamSpi() throws NotImplementedException {
33: // TODO: implement
34: throw new NotImplementedException();
35: }
36:
37: public ImageInputStreamSpi(String vendorName, String version,
38: Class<?> inputClass) {
39: super (vendorName, version);
40: this .inputClass = inputClass;
41: }
42:
43: public Class<?> getInputClass() {
44: return inputClass;
45: }
46:
47: public boolean canUseCacheFile() {
48: return false; //-- def
49: }
50:
51: public boolean needsCacheFile() {
52: return false; // def
53: }
54:
55: public abstract ImageInputStream createInputStreamInstance(
56: Object input, boolean useCache, File cacheDir)
57: throws IOException;
58:
59: public ImageInputStream createInputStreamInstance(Object input)
60: throws IOException {
61: return createInputStreamInstance(input, true, null);
62: }
63: }
|