~hjd/ubuntu/wily/xmlgraphics-commons/debian-merged

« back to all changes in this revision

Viewing changes to src/java/org/apache/xmlgraphics/image/loader/impl/JPEGFile.java

  • Committer: Bazaar Package Importer
  • Author(s): Vincent Fourmond
  • Date: 2011-02-11 14:15:14 UTC
  • mfrom: (8.1.2 experimental)
  • Revision ID: james.westby@ubuntu.com-20110211141514-h67achft6x31gju1
Tags: 1.4.dfsg-3
Uploading to unstable, hoping we won't break too many things ;-)...

Show diffs side-by-side

added added

removed removed

Lines of Context:
5
5
 * The ASF licenses this file to You under the Apache License, Version 2.0
6
6
 * (the "License"); you may not use this file except in compliance with
7
7
 * the License.  You may obtain a copy of the License at
8
 
 * 
 
8
 *
9
9
 *      http://www.apache.org/licenses/LICENSE-2.0
10
 
 * 
 
10
 *
11
11
 * Unless required by applicable law or agreed to in writing, software
12
12
 * distributed under the License is distributed on an "AS IS" BASIS,
13
13
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
15
 * limitations under the License.
16
16
 */
17
17
 
18
 
/* $Id: JPEGFile.java 641214 2008-03-26 09:12:09Z jeremias $ */
 
18
/* $Id: JPEGFile.java 750418 2009-03-05 11:03:54Z vhennebert $ */
19
19
 
20
20
package org.apache.xmlgraphics.image.loader.impl;
21
21
 
37
37
    protected static Log log = LogFactory.getLog(JPEGFile.class);
38
38
 
39
39
    private DataInput in;
40
 
    
 
40
 
41
41
    /**
42
42
     * Constructor for ImageInputStreams.
43
43
     * @param in the input stream to read the image from
45
45
    public JPEGFile(ImageInputStream in) {
46
46
        this.in = in;
47
47
    }
48
 
    
 
48
 
49
49
    /**
50
50
     * Constructor for InputStreams.
51
51
     * @param in the input stream to read the image from
53
53
    public JPEGFile(InputStream in) {
54
54
        this.in = new java.io.DataInputStream(in);
55
55
    }
56
 
    
 
56
 
57
57
    /**
58
58
     * Returns the {@link DataInput} instance this object operates on.
59
59
     * @return the data input instance
61
61
    public DataInput getDataInput() {
62
62
        return this.in;
63
63
    }
64
 
    
 
64
 
65
65
    /**
66
66
     * Reads the next marker segment identifier and returns it.
67
67
     * @return the marker segment identifier
92
92
        int reclen = in.readUnsignedShort();
93
93
        return reclen;
94
94
    }
95
 
    
 
95
 
96
96
    /**
97
97
     * Skips the current marker segment.
98
98
     * The method assumes the file cursor is right after the segment header.
102
102
        int reclen = readSegmentLength();
103
103
        in.skipBytes(reclen - 2);
104
104
    }
105
 
    
 
105
 
106
106
}