~ubuntu-branches/ubuntu/utopic/libcommons-compress-java/utopic

« back to all changes in this revision

Viewing changes to src/main/java/org/apache/commons/compress/archivers/zip/ExtraFieldUtils.java

  • Committer: Package Import Robot
  • Author(s): Emmanuel Bourg
  • Date: 2014-03-13 08:37:01 UTC
  • mfrom: (1.1.6)
  • Revision ID: package-import@ubuntu.com-20140313083701-spnlyo3fl3qcp0ab
Tags: 1.8-1
* New upstream release
* Updated the OSGi metadata
* The dependency on libxz-java is now suggested and no longer required

Show diffs side-by-side

added added

removed removed

Lines of Context:
134
134
        LOOP:
135
135
        while (start <= data.length - WORD) {
136
136
            ZipShort headerId = new ZipShort(data, start);
137
 
            int length = (new ZipShort(data, start + 2)).getValue();
 
137
            int length = new ZipShort(data, start + 2).getValue();
138
138
            if (start + WORD + length > data.length) {
139
139
                switch(onUnparseableData.getKey()) {
140
140
                case UnparseableExtraField.THROW_KEY:
176
176
                }
177
177
                v.add(ze);
178
178
            } catch (InstantiationException ie) {
179
 
                throw new ZipException(ie.getMessage());
 
179
                throw (ZipException) new ZipException(ie.getMessage()).initCause(ie);
180
180
            } catch (IllegalAccessException iae) {
181
 
                throw new ZipException(iae.getMessage());
 
181
                throw (ZipException) new ZipException(iae.getMessage()).initCause(iae);
182
182
            }
183
 
            start += (length + WORD);
 
183
            start += length + WORD;
184
184
        }
185
185
 
186
186
        ZipExtraField[] result = new ZipExtraField[v.size()];
212
212
                             0, result, start + 2, 2);
213
213
            byte[] local = data[i].getLocalFileDataData();
214
214
            System.arraycopy(local, 0, result, start + WORD, local.length);
215
 
            start += (local.length + WORD);
 
215
            start += local.length + WORD;
216
216
        }
217
217
        if (lastIsUnparseableHolder) {
218
218
            byte[] local = data[data.length - 1].getLocalFileDataData();
245
245
                             0, result, start + 2, 2);
246
246
            byte[] local = data[i].getCentralDirectoryData();
247
247
            System.arraycopy(local, 0, result, start + WORD, local.length);
248
 
            start += (local.length + WORD);
 
248
            start += local.length + WORD;
249
249
        }
250
250
        if (lastIsUnparseableHolder) {
251
251
            byte[] local = data[data.length - 1].getCentralDirectoryData();