comparison common/src/main/java/digilib/io/ImageCacheStream.java @ 903:7779b37d1d05

refactored into maven modules per servlet type. can build servlet-api 2.3 and 3.0 via profile now!
author robcast
date Tue, 26 Apr 2011 20:24:31 +0200
parents servlet/src/main/java/digilib/io/ImageCacheStream.java@ba1eb2d821a2
children 28d007673346
comparison
equal deleted inserted replaced
902:89ba3ffcf552 903:7779b37d1d05
1 /**
2 *
3 */
4 package digilib.io;
5
6 import java.io.InputStream;
7
8 import javax.imageio.stream.ImageInputStream;
9 import javax.imageio.stream.MemoryCacheImageInputStream;
10
11 /**
12 * @author casties
13 *
14 */
15 public class ImageCacheStream extends ImageStream {
16
17 public ImageCacheStream(InputStream stream, String mimeType) {
18 super(stream, mimeType);
19 }
20
21 /*
22 * (non-Javadoc)
23 *
24 * @see digilib.io.ImageInput#hasImageInputStream()
25 */
26 @Override
27 public boolean hasImageInputStream() {
28 return true;
29 }
30
31 /*
32 * (non-Javadoc)
33 *
34 * @see digilib.io.ImageInput#getImageInputStream()
35 */
36 @Override
37 public ImageInputStream getImageInputStream() {
38 /*
39 * TODO: which type of stream backing?
40 * In general, it is preferable to
41 * use a FileCacheImageInputStream when reading from a regular
42 * InputStream. This class is provided for cases where it is not
43 * possible to create a writable temporary file.
44 */
45 ImageInputStream iis = new MemoryCacheImageInputStream(this.stream);
46 return iis;
47 }
48
49 }