annotate common/src/main/java/digilib/io/ImageStream.java @ 1158:2ee261676828 default tip

better out-of-the box experience: * digilib works without config files using sensible defaults * new sample images folder used by default * config files moved to templates
author robcast
date Tue, 19 Feb 2013 17:32:25 +0100
parents 28d007673346
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
587
720d061a1b30 more work on stream input
robcast
parents:
diff changeset
1 /**
720d061a1b30 more work on stream input
robcast
parents:
diff changeset
2 *
720d061a1b30 more work on stream input
robcast
parents:
diff changeset
3 */
720d061a1b30 more work on stream input
robcast
parents:
diff changeset
4 package digilib.io;
720d061a1b30 more work on stream input
robcast
parents:
diff changeset
5
720d061a1b30 more work on stream input
robcast
parents:
diff changeset
6 import java.io.InputStream;
720d061a1b30 more work on stream input
robcast
parents:
diff changeset
7
720d061a1b30 more work on stream input
robcast
parents:
diff changeset
8 /**
720d061a1b30 more work on stream input
robcast
parents:
diff changeset
9 * @author casties
590
69bc69381ac4 more work on stream input and more cleanup
robcast
parents: 587
diff changeset
10 *
587
720d061a1b30 more work on stream input
robcast
parents:
diff changeset
11 */
720d061a1b30 more work on stream input
robcast
parents:
diff changeset
12 public class ImageStream extends ImageInput {
720d061a1b30 more work on stream input
robcast
parents:
diff changeset
13
590
69bc69381ac4 more work on stream input and more cleanup
robcast
parents: 587
diff changeset
14 protected InputStream stream = null;
69bc69381ac4 more work on stream input and more cleanup
robcast
parents: 587
diff changeset
15
906
28d007673346 really works with streams now.
robcast
parents: 903
diff changeset
16 /** Create ImageStream from InputStream and String.
28d007673346 really works with streams now.
robcast
parents: 903
diff changeset
17 *
28d007673346 really works with streams now.
robcast
parents: 903
diff changeset
18 * @param stream
28d007673346 really works with streams now.
robcast
parents: 903
diff changeset
19 * @param mimeType mime-type
28d007673346 really works with streams now.
robcast
parents: 903
diff changeset
20 */
590
69bc69381ac4 more work on stream input and more cleanup
robcast
parents: 587
diff changeset
21 public ImageStream(InputStream stream, String mimeType) {
69bc69381ac4 more work on stream input and more cleanup
robcast
parents: 587
diff changeset
22 this.stream = stream;
69bc69381ac4 more work on stream input and more cleanup
robcast
parents: 587
diff changeset
23 this.mimetype = mimeType;
69bc69381ac4 more work on stream input and more cleanup
robcast
parents: 587
diff changeset
24 }
69bc69381ac4 more work on stream input and more cleanup
robcast
parents: 587
diff changeset
25
69bc69381ac4 more work on stream input and more cleanup
robcast
parents: 587
diff changeset
26 /*
69bc69381ac4 more work on stream input and more cleanup
robcast
parents: 587
diff changeset
27 * (non-Javadoc)
69bc69381ac4 more work on stream input and more cleanup
robcast
parents: 587
diff changeset
28 *
69bc69381ac4 more work on stream input and more cleanup
robcast
parents: 587
diff changeset
29 * @see digilib.io.ImageInput#hasInputStream()
69bc69381ac4 more work on stream input and more cleanup
robcast
parents: 587
diff changeset
30 */
69bc69381ac4 more work on stream input and more cleanup
robcast
parents: 587
diff changeset
31 @Override
69bc69381ac4 more work on stream input and more cleanup
robcast
parents: 587
diff changeset
32 public boolean hasInputStream() {
69bc69381ac4 more work on stream input and more cleanup
robcast
parents: 587
diff changeset
33 return true;
69bc69381ac4 more work on stream input and more cleanup
robcast
parents: 587
diff changeset
34 }
69bc69381ac4 more work on stream input and more cleanup
robcast
parents: 587
diff changeset
35
69bc69381ac4 more work on stream input and more cleanup
robcast
parents: 587
diff changeset
36 /*
69bc69381ac4 more work on stream input and more cleanup
robcast
parents: 587
diff changeset
37 * (non-Javadoc)
69bc69381ac4 more work on stream input and more cleanup
robcast
parents: 587
diff changeset
38 *
69bc69381ac4 more work on stream input and more cleanup
robcast
parents: 587
diff changeset
39 * @see digilib.io.ImageInput#getInputStream()
69bc69381ac4 more work on stream input and more cleanup
robcast
parents: 587
diff changeset
40 */
69bc69381ac4 more work on stream input and more cleanup
robcast
parents: 587
diff changeset
41 @Override
69bc69381ac4 more work on stream input and more cleanup
robcast
parents: 587
diff changeset
42 public InputStream getInputStream() {
69bc69381ac4 more work on stream input and more cleanup
robcast
parents: 587
diff changeset
43 return stream;
69bc69381ac4 more work on stream input and more cleanup
robcast
parents: 587
diff changeset
44 }
69bc69381ac4 more work on stream input and more cleanup
robcast
parents: 587
diff changeset
45
587
720d061a1b30 more work on stream input
robcast
parents:
diff changeset
46 }