RandomAccessFileOrArray.java

1
/*
2
 * $Id: RandomAccessFileOrArray.java 4065 2009-09-16 23:09:11Z psoares33 $
3
 *
4
 * Copyright 2001, 2002 Paulo Soares
5
 *
6
 * The contents of this file are subject to the Mozilla Public License Version 1.1
7
 * (the "License"); you may not use this file except in compliance with the License.
8
 * You may obtain a copy of the License at http://www.mozilla.org/MPL/
9
 *
10
 * Software distributed under the License is distributed on an "AS IS" basis,
11
 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
12
 * for the specific language governing rights and limitations under the License.
13
 *
14
 * The Original Code is 'iText, a free JAVA-PDF library'.
15
 *
16
 * The Initial Developer of the Original Code is Bruno Lowagie. Portions created by
17
 * the Initial Developer are Copyright (C) 1999, 2000, 2001, 2002 by Bruno Lowagie.
18
 * All Rights Reserved.
19
 * Co-Developer of the code is Paulo Soares. Portions created by the Co-Developer
20
 * are Copyright (C) 2000, 2001, 2002 by Paulo Soares. All Rights Reserved.
21
 *
22
 * Contributor(s): all the names of the contributors are added in the source code
23
 * where applicable.
24
 *
25
 * Alternatively, the contents of this file may be used under the terms of the
26
 * LGPL license (the "GNU LIBRARY GENERAL PUBLIC LICENSE"), in which case the
27
 * provisions of LGPL are applicable instead of those above.  If you wish to
28
 * allow use of your version of this file only under the terms of the LGPL
29
 * License and not to allow others to use your version of this file under
30
 * the MPL, indicate your decision by deleting the provisions above and
31
 * replace them with the notice and other provisions required by the LGPL.
32
 * If you do not delete the provisions above, a recipient may use your version
33
 * of this file under either the MPL or the GNU LIBRARY GENERAL PUBLIC LICENSE.
34
 *
35
 * This library is free software; you can redistribute it and/or modify it
36
 * under the terms of the MPL as stated above or under the terms of the GNU
37
 * Library General Public License as published by the Free Software Foundation;
38
 * either version 2 of the License, or any later version.
39
 *
40
 * This library is distributed in the hope that it will be useful, but WITHOUT
41
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
42
 * FOR A PARTICULAR PURPOSE. See the GNU Library general Public License for more
43
 * details.
44
 *
45
 * If you didn't download this code from the following link, you should check if
46
 * you aren't using an obsolete version:
47
 * http://www.lowagie.com/iText/
48
 */
49
50
package com.lowagie.text.pdf;
51
52
import java.io.ByteArrayOutputStream;
53
import java.io.Closeable;
54
import java.io.DataInput;
55
import java.io.DataInputStream;
56
import java.io.EOFException;
57
import java.io.File;
58
import java.io.FileInputStream;
59
import java.io.IOException;
60
import java.io.InputStream;
61
import java.io.RandomAccessFile;
62
import java.net.URL;
63
import java.nio.channels.FileChannel;
64
65
import com.lowagie.text.Document;
66
import com.lowagie.text.FontFactory;
67
import com.lowagie.text.error_messages.MessageLocalization;
68
69
/**
70
 * An implementation of a RandomAccessFile for input only
71
 * that accepts a file or a byte array as data source.
72
 *
73
 * @author Paulo Soares (psoares@consiste.pt)
74
 */
75
public class RandomAccessFileOrArray implements DataInput, Closeable {
76
    
77
    MappedRandomAccessFile rf;
78
    RandomAccessFile trf;
79
    boolean plainRandomAccess;
80
    String filename;
81
    byte[] arrayIn;
82
    int arrayInPtr;
83
    byte back;
84
    boolean isBack = false;
85
    
86
    /** Holds value of property startOffset. */
87
    private int startOffset = 0;
88
89
    public RandomAccessFileOrArray(String filename) throws IOException {
90
        this(filename, false, Document.plainRandomAccess);
91
    }
92
    
93
    public RandomAccessFileOrArray(String filename, boolean forceRead, boolean plainRandomAccess) throws IOException {
94
        this.plainRandomAccess = plainRandomAccess;
95
        File file = new File(filename);
96 2 1. : negated conditional → NO_COVERAGE
2. : negated conditional → NO_COVERAGE
        if (!file.exists() && FontFactory.isRegistered(filename)) {
97
            filename = (String) FontFactory.getFontImp().getFontPath(filename);
98
            file = new File(filename);
99
        }
100 1 1. : negated conditional → NO_COVERAGE
        if (!file.canRead()) {
101 2 1. : negated conditional → NO_COVERAGE
2. : negated conditional → NO_COVERAGE
            if (filename.startsWith("file:/") || filename.startsWith("http://") 
102 3 1. : negated conditional → NO_COVERAGE
2. : negated conditional → NO_COVERAGE
3. : negated conditional → NO_COVERAGE
                    || filename.startsWith("https://") || filename.startsWith("jar:") || filename.startsWith("wsjar:")) {
103
                try (InputStream is = new URL(filename).openStream()) {
104
                    this.arrayIn = InputStreamToArray(is);
105
                    return;
106
                }
107
            }
108
            else {
109
                InputStream is = null;
110 1 1. : negated conditional → NO_COVERAGE
                if ("-".equals(filename)) {
111
                    is = System.in;
112
                }
113
                else {
114
                    is = BaseFont.getResourceStream(filename);
115
                }
116 1 1. : negated conditional → NO_COVERAGE
                if (is == null)
117
                    throw new IOException(MessageLocalization.getComposedMessage("1.not.found.as.file.or.resource", filename));
118
                try {
119
                    this.arrayIn = InputStreamToArray(is);
120
                    return;
121
                }
122
                finally {
123 1 1. : removed call to java/io/InputStream::close → NO_COVERAGE
                    try {is.close();}catch(IOException ioe){}
124
                }
125
            }
126
        }
127 1 1. : negated conditional → NO_COVERAGE
        else if (forceRead) {
128
            try (InputStream s = new FileInputStream(file)) {
129
                this.arrayIn = InputStreamToArray(s);
130
            }
131
            return;
132
        }
133
        this.filename = filename;
134 1 1. : negated conditional → NO_COVERAGE
        if (plainRandomAccess)
135
            trf = new RandomAccessFile(filename, "r");
136
        else
137
            rf = new MappedRandomAccessFile(filename, "r");
138
    }
139
140
    public RandomAccessFileOrArray(URL url) throws IOException {
141
        try (InputStream is = url.openStream()) {
142
            this.arrayIn = InputStreamToArray(is);
143
        }
144
    }
145
146
    public RandomAccessFileOrArray(InputStream is) throws IOException {
147
        this.arrayIn = InputStreamToArray(is);
148
    }
149
    
150
    public static byte[] InputStreamToArray(InputStream is) throws IOException {
151
        byte[] b = new byte[8192];
152
        ByteArrayOutputStream out = new ByteArrayOutputStream();
153
        while (true) {
154
            int read = is.read(b);
155 2 1. InputStreamToArray : changed conditional boundary → NO_COVERAGE
2. InputStreamToArray : negated conditional → NO_COVERAGE
            if (read < 1)
156
                break;
157 1 1. InputStreamToArray : removed call to java/io/ByteArrayOutputStream::write → NO_COVERAGE
            out.write(b, 0, read);
158
        }
159 1 1. InputStreamToArray : removed call to java/io/ByteArrayOutputStream::close → NO_COVERAGE
        out.close();
160 1 1. InputStreamToArray : mutated return of Object value for com/lowagie/text/pdf/RandomAccessFileOrArray::InputStreamToArray to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE
        return out.toByteArray();
161
    }
162
163
    public RandomAccessFileOrArray(byte[] arrayIn) {
164
        this.arrayIn = arrayIn;
165
    }
166
    
167
    public RandomAccessFileOrArray(RandomAccessFileOrArray file) {
168
        filename = file.filename;
169
        arrayIn = file.arrayIn;
170
        startOffset = file.startOffset;
171
        plainRandomAccess = file.plainRandomAccess;
172
    }
173
    
174
    public void pushBack(byte b) {
175
        back = b;
176
        isBack = true;
177
    }
178
    
179
    public int read() throws IOException {
180 1 1. read : negated conditional → NO_COVERAGE
        if(isBack) {
181
            isBack = false;
182 2 1. read : Replaced bitwise AND with OR → NO_COVERAGE
2. read : replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE
            return back & 0xff;
183
        }
184 1 1. read : negated conditional → NO_COVERAGE
        if (arrayIn == null)
185 2 1. read : negated conditional → NO_COVERAGE
2. read : replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE
            return plainRandomAccess ? trf.read() : rf.read();
186
        else {
187 2 1. read : changed conditional boundary → NO_COVERAGE
2. read : negated conditional → NO_COVERAGE
            if (arrayInPtr >= arrayIn.length)
188 1 1. read : replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE
                return -1;
189 3 1. read : Replaced integer addition with subtraction → NO_COVERAGE
2. read : Replaced bitwise AND with OR → NO_COVERAGE
3. read : replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE
            return arrayIn[arrayInPtr++] & 0xff;
190
        }
191
    }
192
    
193
    public int read(byte[] b, int off, int len) throws IOException {
194 1 1. read : negated conditional → NO_COVERAGE
        if (len == 0)
195 1 1. read : replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE
            return 0;
196
        int n = 0;
197 1 1. read : negated conditional → NO_COVERAGE
        if (isBack) {
198
            isBack = false;
199 1 1. read : negated conditional → NO_COVERAGE
            if (len == 1) {
200
                b[off] = back;
201 1 1. read : replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE
                return 1;
202
            }
203
            else {
204
                n = 1;
205 1 1. read : Changed increment from 1 to -1 → NO_COVERAGE
                b[off++] = back;
206 1 1. read : Changed increment from -1 to 1 → NO_COVERAGE
                --len;
207
            }
208
        }
209 1 1. read : negated conditional → NO_COVERAGE
        if (arrayIn == null) {
210 3 1. read : Replaced integer addition with subtraction → NO_COVERAGE
2. read : negated conditional → NO_COVERAGE
3. read : replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE
            return (plainRandomAccess ? trf.read(b, off, len) : rf.read(b, off, len)) + n;
211
        }
212
        else {
213 2 1. read : changed conditional boundary → NO_COVERAGE
2. read : negated conditional → NO_COVERAGE
            if (arrayInPtr >= arrayIn.length)
214 1 1. read : replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE
                return -1;
215 3 1. read : changed conditional boundary → NO_COVERAGE
2. read : Replaced integer addition with subtraction → NO_COVERAGE
3. read : negated conditional → NO_COVERAGE
            if (arrayInPtr + len > arrayIn.length)
216 1 1. read : Replaced integer subtraction with addition → NO_COVERAGE
                len = arrayIn.length - arrayInPtr;
217 1 1. read : removed call to java/lang/System::arraycopy → NO_COVERAGE
            System.arraycopy(arrayIn, arrayInPtr, b, off, len);
218 1 1. read : Replaced integer addition with subtraction → NO_COVERAGE
            arrayInPtr += len;
219 2 1. read : Replaced integer addition with subtraction → NO_COVERAGE
2. read : replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE
            return len + n;
220
        }
221
    }
222
    
223
    public int read(byte[] b) throws IOException {
224 1 1. read : replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE
        return read(b, 0, b.length);
225
    }
226
    
227
    public void readFully(byte[] b) throws IOException {
228 1 1. readFully : removed call to com/lowagie/text/pdf/RandomAccessFileOrArray::readFully → NO_COVERAGE
        readFully(b, 0, b.length);
229
    }
230
    
231
    public void readFully(byte[] b, int off, int len) throws IOException {
232
        int n = 0;
233
        do {
234 2 1. readFully : Replaced integer addition with subtraction → NO_COVERAGE
2. readFully : Replaced integer subtraction with addition → NO_COVERAGE
            int count = read(b, off + n, len - n);
235 2 1. readFully : changed conditional boundary → NO_COVERAGE
2. readFully : negated conditional → NO_COVERAGE
            if (count < 0)
236
                throw new EOFException();
237 1 1. readFully : Replaced integer addition with subtraction → NO_COVERAGE
            n += count;
238 2 1. readFully : changed conditional boundary → NO_COVERAGE
2. readFully : negated conditional → NO_COVERAGE
        } while (n < len);
239
    }
240
    
241
    public long skip(long n) throws IOException {
242 1 1. skip : replaced return of long value with value + 1 for com/lowagie/text/pdf/RandomAccessFileOrArray::skip → NO_COVERAGE
        return skipBytes((int)n);
243
    }
244
    
245
    public int skipBytes(int n) throws IOException {
246 2 1. skipBytes : changed conditional boundary → NO_COVERAGE
2. skipBytes : negated conditional → NO_COVERAGE
        if (n <= 0) {
247 1 1. skipBytes : replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE
            return 0;
248
        }
249
        int adj = 0;
250 1 1. skipBytes : negated conditional → NO_COVERAGE
        if (isBack) {
251
            isBack = false;
252 1 1. skipBytes : negated conditional → NO_COVERAGE
            if (n == 1) {
253 1 1. skipBytes : replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE
                return 1;
254
            }
255
            else {
256 1 1. skipBytes : Changed increment from -1 to 1 → NO_COVERAGE
                --n;
257
                adj = 1;
258
            }
259
        }
260
        int pos;
261
        int len;
262
        int newpos;
263
        
264
        pos = getFilePointer();
265
        len = length();
266 1 1. skipBytes : Replaced integer addition with subtraction → NO_COVERAGE
        newpos = pos + n;
267 2 1. skipBytes : changed conditional boundary → NO_COVERAGE
2. skipBytes : negated conditional → NO_COVERAGE
        if (newpos > len) {
268
            newpos = len;
269
        }
270 1 1. skipBytes : removed call to com/lowagie/text/pdf/RandomAccessFileOrArray::seek → NO_COVERAGE
        seek(newpos);
271
        
272
        /* return the actual number of bytes skipped */
273 3 1. skipBytes : Replaced integer subtraction with addition → NO_COVERAGE
2. skipBytes : Replaced integer addition with subtraction → NO_COVERAGE
3. skipBytes : replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE
        return newpos - pos + adj;
274
    }
275
    
276
    public void reOpen() throws IOException {
277 3 1. reOpen : negated conditional → NO_COVERAGE
2. reOpen : negated conditional → NO_COVERAGE
3. reOpen : negated conditional → NO_COVERAGE
        if (filename != null && rf == null && trf == null) {
278 1 1. reOpen : negated conditional → NO_COVERAGE
            if (plainRandomAccess)
279
                trf = new RandomAccessFile(filename, "r");
280
            else
281
                rf = new MappedRandomAccessFile(filename, "r");
282
        }
283 1 1. reOpen : removed call to com/lowagie/text/pdf/RandomAccessFileOrArray::seek → NO_COVERAGE
        seek(0);
284
    }
285
    
286
    protected void insureOpen() throws IOException {
287 3 1. insureOpen : negated conditional → NO_COVERAGE
2. insureOpen : negated conditional → NO_COVERAGE
3. insureOpen : negated conditional → NO_COVERAGE
        if (filename != null && rf == null && trf == null) {
288 1 1. insureOpen : removed call to com/lowagie/text/pdf/RandomAccessFileOrArray::reOpen → NO_COVERAGE
            reOpen();
289
        }
290
    }
291
    
292
    public boolean isOpen() {
293 4 1. isOpen : negated conditional → NO_COVERAGE
2. isOpen : negated conditional → NO_COVERAGE
3. isOpen : negated conditional → NO_COVERAGE
4. isOpen : replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE
        return (filename == null || rf != null || trf != null);
294
    }
295
    
296
    public void close() throws IOException {
297
        isBack = false;
298 1 1. close : negated conditional → NO_COVERAGE
        if (rf != null) {
299 1 1. close : removed call to com/lowagie/text/pdf/MappedRandomAccessFile::close → NO_COVERAGE
            rf.close();
300
            rf = null;
301
            // it's very expensive to open a memory mapped file and for the usage pattern of this class
302
            // in iText it's faster the next re-openings to be done as a plain random access
303
            // file
304
            plainRandomAccess = true;
305
        }
306 1 1. close : negated conditional → NO_COVERAGE
        else if (trf != null) {
307 1 1. close : removed call to java/io/RandomAccessFile::close → NO_COVERAGE
            trf.close();
308
            trf = null;
309
        }
310
    }
311
    
312
    public int length() throws IOException {
313 1 1. length : negated conditional → NO_COVERAGE
        if (arrayIn == null) {
314 1 1. length : removed call to com/lowagie/text/pdf/RandomAccessFileOrArray::insureOpen → NO_COVERAGE
            insureOpen();
315 3 1. length : Replaced integer subtraction with addition → NO_COVERAGE
2. length : negated conditional → NO_COVERAGE
3. length : replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE
            return (int)(plainRandomAccess ? trf.length() : rf.length()) - startOffset;
316
        }
317
        else
318 2 1. length : Replaced integer subtraction with addition → NO_COVERAGE
2. length : replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE
            return arrayIn.length - startOffset;
319
    }
320
    
321
    public void seek(int pos) throws IOException {
322 1 1. seek : Replaced integer addition with subtraction → NO_COVERAGE
        pos += startOffset;
323
        isBack = false;
324 1 1. seek : negated conditional → NO_COVERAGE
        if (arrayIn == null) {
325 1 1. seek : removed call to com/lowagie/text/pdf/RandomAccessFileOrArray::insureOpen → NO_COVERAGE
            insureOpen();
326 1 1. seek : negated conditional → NO_COVERAGE
            if (plainRandomAccess)
327 1 1. seek : removed call to java/io/RandomAccessFile::seek → NO_COVERAGE
                trf.seek(pos);
328
            else
329 1 1. seek : removed call to com/lowagie/text/pdf/MappedRandomAccessFile::seek → NO_COVERAGE
                rf.seek(pos);
330
        }
331
        else
332
            arrayInPtr = pos;
333
    }
334
    
335
    public void seek(long pos) throws IOException {
336 1 1. seek : removed call to com/lowagie/text/pdf/RandomAccessFileOrArray::seek → NO_COVERAGE
        seek((int)pos);
337
    }
338
    
339
    public int getFilePointer() throws IOException {
340 1 1. getFilePointer : removed call to com/lowagie/text/pdf/RandomAccessFileOrArray::insureOpen → NO_COVERAGE
        insureOpen();
341 1 1. getFilePointer : negated conditional → NO_COVERAGE
        int n = isBack ? 1 : 0;
342 1 1. getFilePointer : negated conditional → NO_COVERAGE
        if (arrayIn == null) {
343 4 1. getFilePointer : Replaced integer subtraction with addition → NO_COVERAGE
2. getFilePointer : Replaced integer subtraction with addition → NO_COVERAGE
3. getFilePointer : negated conditional → NO_COVERAGE
4. getFilePointer : replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE
            return (int)(plainRandomAccess ? trf.getFilePointer() : rf.getFilePointer()) - n - startOffset;
344
        }
345
        else
346 3 1. getFilePointer : Replaced integer subtraction with addition → NO_COVERAGE
2. getFilePointer : Replaced integer subtraction with addition → NO_COVERAGE
3. getFilePointer : replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE
            return arrayInPtr - n - startOffset;
347
    }
348
    
349
    public boolean readBoolean() throws IOException {
350
        int ch = this.read();
351 2 1. readBoolean : changed conditional boundary → NO_COVERAGE
2. readBoolean : negated conditional → NO_COVERAGE
        if (ch < 0)
352
            throw new EOFException();
353 2 1. readBoolean : negated conditional → NO_COVERAGE
2. readBoolean : replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE
        return (ch != 0);
354
    }
355
    
356
    public byte readByte() throws IOException {
357
        int ch = this.read();
358 2 1. readByte : changed conditional boundary → NO_COVERAGE
2. readByte : negated conditional → NO_COVERAGE
        if (ch < 0)
359
            throw new EOFException();
360 1 1. readByte : replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE
        return (byte)(ch);
361
    }
362
    
363
    public int readUnsignedByte() throws IOException {
364
        int ch = this.read();
365 2 1. readUnsignedByte : changed conditional boundary → NO_COVERAGE
2. readUnsignedByte : negated conditional → NO_COVERAGE
        if (ch < 0)
366
            throw new EOFException();
367 1 1. readUnsignedByte : replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE
        return ch;
368
    }
369
    
370
    public short readShort() throws IOException {
371
        int ch1 = this.read();
372
        int ch2 = this.read();
373 3 1. readShort : changed conditional boundary → NO_COVERAGE
2. readShort : Replaced bitwise OR with AND → NO_COVERAGE
3. readShort : negated conditional → NO_COVERAGE
        if ((ch1 | ch2) < 0)
374
            throw new EOFException();
375 3 1. readShort : Replaced Shift Left with Shift Right → NO_COVERAGE
2. readShort : Replaced integer addition with subtraction → NO_COVERAGE
3. readShort : replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE
        return (short)((ch1 << 8) + ch2);
376
    }
377
    
378
    /**
379
     * Reads a signed 16-bit number from this stream in little-endian order.
380
     * The method reads two
381
     * bytes from this stream, starting at the current stream pointer.
382
     * If the two bytes read, in order, are
383
     * <code>b1</code> and <code>b2</code>, where each of the two values is
384
     * between <code>0</code> and <code>255</code>, inclusive, then the
385
     * result is equal to:
386
     * <blockquote><pre>
387
     *     (short)((b2 &lt;&lt; 8) | b1)
388
     * </pre></blockquote>
389
     * <p>
390
     * This method blocks until the two bytes are read, the end of the
391
     * stream is detected, or an exception is thrown.
392
     *
393
     * @return     the next two bytes of this stream, interpreted as a signed
394
     *             16-bit number.
395
     * @exception  EOFException  if this stream reaches the end before reading
396
     *               two bytes.
397
     * @exception  IOException   if an I/O error occurs.
398
     */
399
    public final short readShortLE() throws IOException {
400
        int ch1 = this.read();
401
        int ch2 = this.read();
402 3 1. readShortLE : changed conditional boundary → NO_COVERAGE
2. readShortLE : Replaced bitwise OR with AND → NO_COVERAGE
3. readShortLE : negated conditional → NO_COVERAGE
        if ((ch1 | ch2) < 0)
403
            throw new EOFException();
404 4 1. readShortLE : Replaced Shift Left with Shift Right → NO_COVERAGE
2. readShortLE : Replaced Shift Left with Shift Right → NO_COVERAGE
3. readShortLE : Replaced integer addition with subtraction → NO_COVERAGE
4. readShortLE : replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE
        return (short)((ch2 << 8) + (ch1 << 0));
405
    }
406
    
407
    public int readUnsignedShort() throws IOException {
408
        int ch1 = this.read();
409
        int ch2 = this.read();
410 3 1. readUnsignedShort : changed conditional boundary → NO_COVERAGE
2. readUnsignedShort : Replaced bitwise OR with AND → NO_COVERAGE
3. readUnsignedShort : negated conditional → NO_COVERAGE
        if ((ch1 | ch2) < 0)
411
            throw new EOFException();
412 3 1. readUnsignedShort : Replaced Shift Left with Shift Right → NO_COVERAGE
2. readUnsignedShort : Replaced integer addition with subtraction → NO_COVERAGE
3. readUnsignedShort : replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE
        return (ch1 << 8) + ch2;
413
    }
414
    
415
    /**
416
     * Reads an unsigned 16-bit number from this stream in little-endian order.
417
     * This method reads
418
     * two bytes from the stream, starting at the current stream pointer.
419
     * If the bytes read, in order, are
420
     * <code>b1</code> and <code>b2</code>, where
421
     * <code>0&nbsp;&lt;=&nbsp;b1, b2&nbsp;&lt;=&nbsp;255</code>,
422
     * then the result is equal to:
423
     * <blockquote><pre>
424
     *     (b2 &lt;&lt; 8) | b1
425
     * </pre></blockquote>
426
     * <p>
427
     * This method blocks until the two bytes are read, the end of the
428
     * stream is detected, or an exception is thrown.
429
     *
430
     * @return     the next two bytes of this stream, interpreted as an
431
     *             unsigned 16-bit integer.
432
     * @exception  EOFException  if this stream reaches the end before reading
433
     *               two bytes.
434
     * @exception  IOException   if an I/O error occurs.
435
     */
436
    public final int readUnsignedShortLE() throws IOException {
437
        int ch1 = this.read();
438
        int ch2 = this.read();
439 3 1. readUnsignedShortLE : changed conditional boundary → NO_COVERAGE
2. readUnsignedShortLE : Replaced bitwise OR with AND → NO_COVERAGE
3. readUnsignedShortLE : negated conditional → NO_COVERAGE
        if ((ch1 | ch2) < 0)
440
            throw new EOFException();
441 4 1. readUnsignedShortLE : Replaced Shift Left with Shift Right → NO_COVERAGE
2. readUnsignedShortLE : Replaced Shift Left with Shift Right → NO_COVERAGE
3. readUnsignedShortLE : Replaced integer addition with subtraction → NO_COVERAGE
4. readUnsignedShortLE : replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE
        return (ch2 << 8) + (ch1 << 0);
442
    }
443
    
444
    public char readChar() throws IOException {
445
        int ch1 = this.read();
446
        int ch2 = this.read();
447 3 1. readChar : changed conditional boundary → NO_COVERAGE
2. readChar : Replaced bitwise OR with AND → NO_COVERAGE
3. readChar : negated conditional → NO_COVERAGE
        if ((ch1 | ch2) < 0)
448
            throw new EOFException();
449 3 1. readChar : Replaced Shift Left with Shift Right → NO_COVERAGE
2. readChar : Replaced integer addition with subtraction → NO_COVERAGE
3. readChar : replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE
        return (char)((ch1 << 8) + ch2);
450
    }
451
    
452
    /**
453
     * Reads a Unicode character from this stream in little-endian order.
454
     * This method reads two
455
     * bytes from the stream, starting at the current stream pointer.
456
     * If the bytes read, in order, are
457
     * <code>b1</code> and <code>b2</code>, where
458
     * <code>0&nbsp;&lt;=&nbsp;b1,&nbsp;b2&nbsp;&lt;=&nbsp;255</code>,
459
     * then the result is equal to:
460
     * <blockquote><pre>
461
     *     (char)((b2 &lt;&lt; 8) | b1)
462
     * </pre></blockquote>
463
     * <p>
464
     * This method blocks until the two bytes are read, the end of the
465
     * stream is detected, or an exception is thrown.
466
     *
467
     * @return     the next two bytes of this stream as a Unicode character.
468
     * @exception  EOFException  if this stream reaches the end before reading
469
     *               two bytes.
470
     * @exception  IOException   if an I/O error occurs.
471
     */
472
    public final char readCharLE() throws IOException {
473
        int ch1 = this.read();
474
        int ch2 = this.read();
475 3 1. readCharLE : changed conditional boundary → NO_COVERAGE
2. readCharLE : Replaced bitwise OR with AND → NO_COVERAGE
3. readCharLE : negated conditional → NO_COVERAGE
        if ((ch1 | ch2) < 0)
476
            throw new EOFException();
477 4 1. readCharLE : Replaced Shift Left with Shift Right → NO_COVERAGE
2. readCharLE : Replaced Shift Left with Shift Right → NO_COVERAGE
3. readCharLE : Replaced integer addition with subtraction → NO_COVERAGE
4. readCharLE : replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE
        return (char)((ch2 << 8) + (ch1 << 0));
478
    }
479
    
480
    public int readInt() throws IOException {
481
        int ch1 = this.read();
482
        int ch2 = this.read();
483
        int ch3 = this.read();
484
        int ch4 = this.read();
485 5 1. readInt : changed conditional boundary → NO_COVERAGE
2. readInt : Replaced bitwise OR with AND → NO_COVERAGE
3. readInt : Replaced bitwise OR with AND → NO_COVERAGE
4. readInt : Replaced bitwise OR with AND → NO_COVERAGE
5. readInt : negated conditional → NO_COVERAGE
        if ((ch1 | ch2 | ch3 | ch4) < 0)
486
            throw new EOFException();
487 7 1. readInt : Replaced Shift Left with Shift Right → NO_COVERAGE
2. readInt : Replaced Shift Left with Shift Right → NO_COVERAGE
3. readInt : Replaced integer addition with subtraction → NO_COVERAGE
4. readInt : Replaced Shift Left with Shift Right → NO_COVERAGE
5. readInt : Replaced integer addition with subtraction → NO_COVERAGE
6. readInt : Replaced integer addition with subtraction → NO_COVERAGE
7. readInt : replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE
        return ((ch1 << 24) + (ch2 << 16) + (ch3 << 8) + ch4);
488
    }
489
    
490
    /**
491
     * Reads a signed 32-bit integer from this stream in little-endian order.
492
     * This method reads 4
493
     * bytes from the stream, starting at the current stream pointer.
494
     * If the bytes read, in order, are <code>b1</code>,
495
     * <code>b2</code>, <code>b3</code>, and <code>b4</code>, where
496
     * <code>0&nbsp;&lt;=&nbsp;b1, b2, b3, b4&nbsp;&lt;=&nbsp;255</code>,
497
     * then the result is equal to:
498
     * <blockquote><pre>
499
     *     (b4 &lt;&lt; 24) | (b3 &lt;&lt; 16) + (b2 &lt;&lt; 8) + b1
500
     * </pre></blockquote>
501
     * <p>
502
     * This method blocks until the four bytes are read, the end of the
503
     * stream is detected, or an exception is thrown.
504
     *
505
     * @return     the next four bytes of this stream, interpreted as an
506
     *             <code>int</code>.
507
     * @exception  EOFException  if this stream reaches the end before reading
508
     *               four bytes.
509
     * @exception  IOException   if an I/O error occurs.
510
     */
511
    public final int readIntLE() throws IOException {
512
        int ch1 = this.read();
513
        int ch2 = this.read();
514
        int ch3 = this.read();
515
        int ch4 = this.read();
516 5 1. readIntLE : changed conditional boundary → NO_COVERAGE
2. readIntLE : Replaced bitwise OR with AND → NO_COVERAGE
3. readIntLE : Replaced bitwise OR with AND → NO_COVERAGE
4. readIntLE : Replaced bitwise OR with AND → NO_COVERAGE
5. readIntLE : negated conditional → NO_COVERAGE
        if ((ch1 | ch2 | ch3 | ch4) < 0)
517
            throw new EOFException();
518 8 1. readIntLE : Replaced Shift Left with Shift Right → NO_COVERAGE
2. readIntLE : Replaced Shift Left with Shift Right → NO_COVERAGE
3. readIntLE : Replaced integer addition with subtraction → NO_COVERAGE
4. readIntLE : Replaced Shift Left with Shift Right → NO_COVERAGE
5. readIntLE : Replaced integer addition with subtraction → NO_COVERAGE
6. readIntLE : Replaced Shift Left with Shift Right → NO_COVERAGE
7. readIntLE : Replaced integer addition with subtraction → NO_COVERAGE
8. readIntLE : replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE
        return ((ch4 << 24) + (ch3 << 16) + (ch2 << 8) + (ch1 << 0));
519
    }
520
    
521
    /**
522
     * Reads an unsigned 32-bit integer from this stream. This method reads 4
523
     * bytes from the stream, starting at the current stream pointer.
524
     * If the bytes read, in order, are <code>b1</code>,
525
     * <code>b2</code>, <code>b3</code>, and <code>b4</code>, where
526
     * <code>0&nbsp;&lt;=&nbsp;b1, b2, b3, b4&nbsp;&lt;=&nbsp;255</code>,
527
     * then the result is equal to:
528
     * <blockquote><pre>
529
     *     (b1 &lt;&lt; 24) | (b2 &lt;&lt; 16) + (b3 &lt;&lt; 8) + b4
530
     * </pre></blockquote>
531
     * <p>
532
     * This method blocks until the four bytes are read, the end of the
533
     * stream is detected, or an exception is thrown.
534
     *
535
     * @return     the next four bytes of this stream, interpreted as a
536
     *             <code>long</code>.
537
     * @exception  EOFException  if this stream reaches the end before reading
538
     *               four bytes.
539
     * @exception  IOException   if an I/O error occurs.
540
     */
541
    public final long readUnsignedInt() throws IOException {
542
        long ch1 = this.read();
543
        long ch2 = this.read();
544
        long ch3 = this.read();
545
        long ch4 = this.read();
546 5 1. readUnsignedInt : changed conditional boundary → NO_COVERAGE
2. readUnsignedInt : Replaced bitwise OR with AND → NO_COVERAGE
3. readUnsignedInt : Replaced bitwise OR with AND → NO_COVERAGE
4. readUnsignedInt : Replaced bitwise OR with AND → NO_COVERAGE
5. readUnsignedInt : negated conditional → NO_COVERAGE
        if ((ch1 | ch2 | ch3 | ch4) < 0)
547
            throw new EOFException();
548 8 1. readUnsignedInt : Replaced Shift Left with Shift Right → NO_COVERAGE
2. readUnsignedInt : Replaced Shift Left with Shift Right → NO_COVERAGE
3. readUnsignedInt : Replaced long addition with subtraction → NO_COVERAGE
4. readUnsignedInt : Replaced Shift Left with Shift Right → NO_COVERAGE
5. readUnsignedInt : Replaced long addition with subtraction → NO_COVERAGE
6. readUnsignedInt : Replaced Shift Left with Shift Right → NO_COVERAGE
7. readUnsignedInt : Replaced long addition with subtraction → NO_COVERAGE
8. readUnsignedInt : replaced return of long value with value + 1 for com/lowagie/text/pdf/RandomAccessFileOrArray::readUnsignedInt → NO_COVERAGE
        return ((ch1 << 24) + (ch2 << 16) + (ch3 << 8) + (ch4 << 0));
549
    }
550
    
551
    public final long readUnsignedIntLE() throws IOException {
552
        long ch1 = this.read();
553
        long ch2 = this.read();
554
        long ch3 = this.read();
555
        long ch4 = this.read();
556 5 1. readUnsignedIntLE : changed conditional boundary → NO_COVERAGE
2. readUnsignedIntLE : Replaced bitwise OR with AND → NO_COVERAGE
3. readUnsignedIntLE : Replaced bitwise OR with AND → NO_COVERAGE
4. readUnsignedIntLE : Replaced bitwise OR with AND → NO_COVERAGE
5. readUnsignedIntLE : negated conditional → NO_COVERAGE
        if ((ch1 | ch2 | ch3 | ch4) < 0)
557
            throw new EOFException();
558 8 1. readUnsignedIntLE : Replaced Shift Left with Shift Right → NO_COVERAGE
2. readUnsignedIntLE : Replaced Shift Left with Shift Right → NO_COVERAGE
3. readUnsignedIntLE : Replaced long addition with subtraction → NO_COVERAGE
4. readUnsignedIntLE : Replaced Shift Left with Shift Right → NO_COVERAGE
5. readUnsignedIntLE : Replaced long addition with subtraction → NO_COVERAGE
6. readUnsignedIntLE : Replaced Shift Left with Shift Right → NO_COVERAGE
7. readUnsignedIntLE : Replaced long addition with subtraction → NO_COVERAGE
8. readUnsignedIntLE : replaced return of long value with value + 1 for com/lowagie/text/pdf/RandomAccessFileOrArray::readUnsignedIntLE → NO_COVERAGE
        return ((ch4 << 24) + (ch3 << 16) + (ch2 << 8) + (ch1 << 0));
559
    }
560
    
561
    public long readLong() throws IOException {
562 4 1. readLong : Replaced Shift Left with Shift Right → NO_COVERAGE
2. readLong : Replaced bitwise AND with OR → NO_COVERAGE
3. readLong : Replaced long addition with subtraction → NO_COVERAGE
4. readLong : replaced return of long value with value + 1 for com/lowagie/text/pdf/RandomAccessFileOrArray::readLong → NO_COVERAGE
        return ((long)(readInt()) << 32) + (readInt() & 0xFFFFFFFFL);
563
    }
564
    
565
    public final long readLongLE() throws IOException {
566
        int i1 = readIntLE();
567
        int i2 = readIntLE();
568 4 1. readLongLE : Replaced Shift Left with Shift Right → NO_COVERAGE
2. readLongLE : Replaced bitwise AND with OR → NO_COVERAGE
3. readLongLE : Replaced long addition with subtraction → NO_COVERAGE
4. readLongLE : replaced return of long value with value + 1 for com/lowagie/text/pdf/RandomAccessFileOrArray::readLongLE → NO_COVERAGE
        return ((long)i2 << 32) + (i1 & 0xFFFFFFFFL);
569
    }
570
    
571
    public float readFloat() throws IOException {
572 1 1. readFloat : replaced return of float value with -(x + 1) for com/lowagie/text/pdf/RandomAccessFileOrArray::readFloat → NO_COVERAGE
        return Float.intBitsToFloat(readInt());
573
    }
574
    
575
    public final float readFloatLE() throws IOException {
576 1 1. readFloatLE : replaced return of float value with -(x + 1) for com/lowagie/text/pdf/RandomAccessFileOrArray::readFloatLE → NO_COVERAGE
        return Float.intBitsToFloat(readIntLE());
577
    }
578
    
579
    public double readDouble() throws IOException {
580 1 1. readDouble : replaced return of double value with -(x + 1) for com/lowagie/text/pdf/RandomAccessFileOrArray::readDouble → NO_COVERAGE
        return Double.longBitsToDouble(readLong());
581
    }
582
    
583
    public final double readDoubleLE() throws IOException {
584 1 1. readDoubleLE : replaced return of double value with -(x + 1) for com/lowagie/text/pdf/RandomAccessFileOrArray::readDoubleLE → NO_COVERAGE
        return Double.longBitsToDouble(readLongLE());
585
    }
586
    
587
    public String readLine() throws IOException {
588
        StringBuilder input = new StringBuilder();
589
        int c = -1;
590
        boolean eol = false;
591
        
592 1 1. readLine : negated conditional → NO_COVERAGE
        while (!eol) {
593
            switch (c = read()) {
594
                case -1:
595
                case '\n':
596
                    eol = true;
597
                    break;
598
                case '\r':
599
                    eol = true;
600
                    int cur = getFilePointer();
601 1 1. readLine : negated conditional → NO_COVERAGE
                    if ((read()) != '\n') {
602 1 1. readLine : removed call to com/lowagie/text/pdf/RandomAccessFileOrArray::seek → NO_COVERAGE
                        seek(cur);
603
                    }
604
                    break;
605
                default:
606
                    input.append((char)c);
607
                    break;
608
            }
609
        }
610
        
611 2 1. readLine : negated conditional → NO_COVERAGE
2. readLine : negated conditional → NO_COVERAGE
        if ((c == -1) && (input.length() == 0)) {
612 1 1. readLine : mutated return of Object value for com/lowagie/text/pdf/RandomAccessFileOrArray::readLine to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE
            return null;
613
        }
614 1 1. readLine : mutated return of Object value for com/lowagie/text/pdf/RandomAccessFileOrArray::readLine to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE
        return input.toString();
615
    }
616
    
617
    public String readUTF() throws IOException {
618 1 1. readUTF : mutated return of Object value for com/lowagie/text/pdf/RandomAccessFileOrArray::readUTF to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE
        return DataInputStream.readUTF(this);
619
    }
620
    
621
    /** Getter for property startOffset.
622
     * @return Value of property startOffset.
623
     *
624
     */
625
    public int getStartOffset() {
626
        return this.startOffset;
627
    }
628
    
629
    /** Setter for property startOffset.
630
     * @param startOffset New value of property startOffset.
631
     *
632
     */
633
    public void setStartOffset(int startOffset) {
634
        this.startOffset = startOffset;
635
    }
636
637
    /**
638
     * @since 2.0.8
639
     */
640
    public java.nio.ByteBuffer getNioByteBuffer() throws IOException {
641 1 1. getNioByteBuffer : negated conditional → NO_COVERAGE
        if (filename != null) {
642
            FileChannel channel;
643 1 1. getNioByteBuffer : negated conditional → NO_COVERAGE
            if (plainRandomAccess)
644
                channel = trf.getChannel();
645
            else
646
                channel = rf.getChannel();
647 1 1. getNioByteBuffer : mutated return of Object value for com/lowagie/text/pdf/RandomAccessFileOrArray::getNioByteBuffer to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE
            return channel.map(FileChannel.MapMode.READ_ONLY, 0, channel.size());
648
        }
649 1 1. getNioByteBuffer : mutated return of Object value for com/lowagie/text/pdf/RandomAccessFileOrArray::getNioByteBuffer to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE
        return java.nio.ByteBuffer.wrap(arrayIn);
650
    }
651
}

Mutations

96

1.1
Location :
Killed by : none
negated conditional → NO_COVERAGE

2.2
Location :
Killed by : none
negated conditional → NO_COVERAGE

100

1.1
Location :
Killed by : none
negated conditional → NO_COVERAGE

101

1.1
Location :
Killed by : none
negated conditional → NO_COVERAGE

2.2
Location :
Killed by : none
negated conditional → NO_COVERAGE

102

1.1
Location :
Killed by : none
negated conditional → NO_COVERAGE

2.2
Location :
Killed by : none
negated conditional → NO_COVERAGE

3.3
Location :
Killed by : none
negated conditional → NO_COVERAGE

110

1.1
Location :
Killed by : none
negated conditional → NO_COVERAGE

116

1.1
Location :
Killed by : none
negated conditional → NO_COVERAGE

123

1.1
Location :
Killed by : none
removed call to java/io/InputStream::close → NO_COVERAGE

127

1.1
Location :
Killed by : none
negated conditional → NO_COVERAGE

134

1.1
Location :
Killed by : none
negated conditional → NO_COVERAGE

155

1.1
Location : InputStreamToArray
Killed by : none
changed conditional boundary → NO_COVERAGE

2.2
Location : InputStreamToArray
Killed by : none
negated conditional → NO_COVERAGE

157

1.1
Location : InputStreamToArray
Killed by : none
removed call to java/io/ByteArrayOutputStream::write → NO_COVERAGE

159

1.1
Location : InputStreamToArray
Killed by : none
removed call to java/io/ByteArrayOutputStream::close → NO_COVERAGE

160

1.1
Location : InputStreamToArray
Killed by : none
mutated return of Object value for com/lowagie/text/pdf/RandomAccessFileOrArray::InputStreamToArray to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE

180

1.1
Location : read
Killed by : none
negated conditional → NO_COVERAGE

182

1.1
Location : read
Killed by : none
Replaced bitwise AND with OR → NO_COVERAGE

2.2
Location : read
Killed by : none
replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE

184

1.1
Location : read
Killed by : none
negated conditional → NO_COVERAGE

185

1.1
Location : read
Killed by : none
negated conditional → NO_COVERAGE

2.2
Location : read
Killed by : none
replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE

187

1.1
Location : read
Killed by : none
changed conditional boundary → NO_COVERAGE

2.2
Location : read
Killed by : none
negated conditional → NO_COVERAGE

188

1.1
Location : read
Killed by : none
replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE

189

1.1
Location : read
Killed by : none
Replaced integer addition with subtraction → NO_COVERAGE

2.2
Location : read
Killed by : none
Replaced bitwise AND with OR → NO_COVERAGE

3.3
Location : read
Killed by : none
replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE

194

1.1
Location : read
Killed by : none
negated conditional → NO_COVERAGE

195

1.1
Location : read
Killed by : none
replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE

197

1.1
Location : read
Killed by : none
negated conditional → NO_COVERAGE

199

1.1
Location : read
Killed by : none
negated conditional → NO_COVERAGE

201

1.1
Location : read
Killed by : none
replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE

205

1.1
Location : read
Killed by : none
Changed increment from 1 to -1 → NO_COVERAGE

206

1.1
Location : read
Killed by : none
Changed increment from -1 to 1 → NO_COVERAGE

209

1.1
Location : read
Killed by : none
negated conditional → NO_COVERAGE

210

1.1
Location : read
Killed by : none
Replaced integer addition with subtraction → NO_COVERAGE

2.2
Location : read
Killed by : none
negated conditional → NO_COVERAGE

3.3
Location : read
Killed by : none
replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE

213

1.1
Location : read
Killed by : none
changed conditional boundary → NO_COVERAGE

2.2
Location : read
Killed by : none
negated conditional → NO_COVERAGE

214

1.1
Location : read
Killed by : none
replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE

215

1.1
Location : read
Killed by : none
changed conditional boundary → NO_COVERAGE

2.2
Location : read
Killed by : none
Replaced integer addition with subtraction → NO_COVERAGE

3.3
Location : read
Killed by : none
negated conditional → NO_COVERAGE

216

1.1
Location : read
Killed by : none
Replaced integer subtraction with addition → NO_COVERAGE

217

1.1
Location : read
Killed by : none
removed call to java/lang/System::arraycopy → NO_COVERAGE

218

1.1
Location : read
Killed by : none
Replaced integer addition with subtraction → NO_COVERAGE

219

1.1
Location : read
Killed by : none
Replaced integer addition with subtraction → NO_COVERAGE

2.2
Location : read
Killed by : none
replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE

224

1.1
Location : read
Killed by : none
replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE

228

1.1
Location : readFully
Killed by : none
removed call to com/lowagie/text/pdf/RandomAccessFileOrArray::readFully → NO_COVERAGE

234

1.1
Location : readFully
Killed by : none
Replaced integer addition with subtraction → NO_COVERAGE

2.2
Location : readFully
Killed by : none
Replaced integer subtraction with addition → NO_COVERAGE

235

1.1
Location : readFully
Killed by : none
changed conditional boundary → NO_COVERAGE

2.2
Location : readFully
Killed by : none
negated conditional → NO_COVERAGE

237

1.1
Location : readFully
Killed by : none
Replaced integer addition with subtraction → NO_COVERAGE

238

1.1
Location : readFully
Killed by : none
changed conditional boundary → NO_COVERAGE

2.2
Location : readFully
Killed by : none
negated conditional → NO_COVERAGE

242

1.1
Location : skip
Killed by : none
replaced return of long value with value + 1 for com/lowagie/text/pdf/RandomAccessFileOrArray::skip → NO_COVERAGE

246

1.1
Location : skipBytes
Killed by : none
changed conditional boundary → NO_COVERAGE

2.2
Location : skipBytes
Killed by : none
negated conditional → NO_COVERAGE

247

1.1
Location : skipBytes
Killed by : none
replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE

250

1.1
Location : skipBytes
Killed by : none
negated conditional → NO_COVERAGE

252

1.1
Location : skipBytes
Killed by : none
negated conditional → NO_COVERAGE

253

1.1
Location : skipBytes
Killed by : none
replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE

256

1.1
Location : skipBytes
Killed by : none
Changed increment from -1 to 1 → NO_COVERAGE

266

1.1
Location : skipBytes
Killed by : none
Replaced integer addition with subtraction → NO_COVERAGE

267

1.1
Location : skipBytes
Killed by : none
changed conditional boundary → NO_COVERAGE

2.2
Location : skipBytes
Killed by : none
negated conditional → NO_COVERAGE

270

1.1
Location : skipBytes
Killed by : none
removed call to com/lowagie/text/pdf/RandomAccessFileOrArray::seek → NO_COVERAGE

273

1.1
Location : skipBytes
Killed by : none
Replaced integer subtraction with addition → NO_COVERAGE

2.2
Location : skipBytes
Killed by : none
Replaced integer addition with subtraction → NO_COVERAGE

3.3
Location : skipBytes
Killed by : none
replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE

277

1.1
Location : reOpen
Killed by : none
negated conditional → NO_COVERAGE

2.2
Location : reOpen
Killed by : none
negated conditional → NO_COVERAGE

3.3
Location : reOpen
Killed by : none
negated conditional → NO_COVERAGE

278

1.1
Location : reOpen
Killed by : none
negated conditional → NO_COVERAGE

283

1.1
Location : reOpen
Killed by : none
removed call to com/lowagie/text/pdf/RandomAccessFileOrArray::seek → NO_COVERAGE

287

1.1
Location : insureOpen
Killed by : none
negated conditional → NO_COVERAGE

2.2
Location : insureOpen
Killed by : none
negated conditional → NO_COVERAGE

3.3
Location : insureOpen
Killed by : none
negated conditional → NO_COVERAGE

288

1.1
Location : insureOpen
Killed by : none
removed call to com/lowagie/text/pdf/RandomAccessFileOrArray::reOpen → NO_COVERAGE

293

1.1
Location : isOpen
Killed by : none
negated conditional → NO_COVERAGE

2.2
Location : isOpen
Killed by : none
negated conditional → NO_COVERAGE

3.3
Location : isOpen
Killed by : none
negated conditional → NO_COVERAGE

4.4
Location : isOpen
Killed by : none
replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE

298

1.1
Location : close
Killed by : none
negated conditional → NO_COVERAGE

299

1.1
Location : close
Killed by : none
removed call to com/lowagie/text/pdf/MappedRandomAccessFile::close → NO_COVERAGE

306

1.1
Location : close
Killed by : none
negated conditional → NO_COVERAGE

307

1.1
Location : close
Killed by : none
removed call to java/io/RandomAccessFile::close → NO_COVERAGE

313

1.1
Location : length
Killed by : none
negated conditional → NO_COVERAGE

314

1.1
Location : length
Killed by : none
removed call to com/lowagie/text/pdf/RandomAccessFileOrArray::insureOpen → NO_COVERAGE

315

1.1
Location : length
Killed by : none
Replaced integer subtraction with addition → NO_COVERAGE

2.2
Location : length
Killed by : none
negated conditional → NO_COVERAGE

3.3
Location : length
Killed by : none
replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE

318

1.1
Location : length
Killed by : none
Replaced integer subtraction with addition → NO_COVERAGE

2.2
Location : length
Killed by : none
replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE

322

1.1
Location : seek
Killed by : none
Replaced integer addition with subtraction → NO_COVERAGE

324

1.1
Location : seek
Killed by : none
negated conditional → NO_COVERAGE

325

1.1
Location : seek
Killed by : none
removed call to com/lowagie/text/pdf/RandomAccessFileOrArray::insureOpen → NO_COVERAGE

326

1.1
Location : seek
Killed by : none
negated conditional → NO_COVERAGE

327

1.1
Location : seek
Killed by : none
removed call to java/io/RandomAccessFile::seek → NO_COVERAGE

329

1.1
Location : seek
Killed by : none
removed call to com/lowagie/text/pdf/MappedRandomAccessFile::seek → NO_COVERAGE

336

1.1
Location : seek
Killed by : none
removed call to com/lowagie/text/pdf/RandomAccessFileOrArray::seek → NO_COVERAGE

340

1.1
Location : getFilePointer
Killed by : none
removed call to com/lowagie/text/pdf/RandomAccessFileOrArray::insureOpen → NO_COVERAGE

341

1.1
Location : getFilePointer
Killed by : none
negated conditional → NO_COVERAGE

342

1.1
Location : getFilePointer
Killed by : none
negated conditional → NO_COVERAGE

343

1.1
Location : getFilePointer
Killed by : none
Replaced integer subtraction with addition → NO_COVERAGE

2.2
Location : getFilePointer
Killed by : none
Replaced integer subtraction with addition → NO_COVERAGE

3.3
Location : getFilePointer
Killed by : none
negated conditional → NO_COVERAGE

4.4
Location : getFilePointer
Killed by : none
replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE

346

1.1
Location : getFilePointer
Killed by : none
Replaced integer subtraction with addition → NO_COVERAGE

2.2
Location : getFilePointer
Killed by : none
Replaced integer subtraction with addition → NO_COVERAGE

3.3
Location : getFilePointer
Killed by : none
replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE

351

1.1
Location : readBoolean
Killed by : none
changed conditional boundary → NO_COVERAGE

2.2
Location : readBoolean
Killed by : none
negated conditional → NO_COVERAGE

353

1.1
Location : readBoolean
Killed by : none
negated conditional → NO_COVERAGE

2.2
Location : readBoolean
Killed by : none
replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE

358

1.1
Location : readByte
Killed by : none
changed conditional boundary → NO_COVERAGE

2.2
Location : readByte
Killed by : none
negated conditional → NO_COVERAGE

360

1.1
Location : readByte
Killed by : none
replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE

365

1.1
Location : readUnsignedByte
Killed by : none
changed conditional boundary → NO_COVERAGE

2.2
Location : readUnsignedByte
Killed by : none
negated conditional → NO_COVERAGE

367

1.1
Location : readUnsignedByte
Killed by : none
replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE

373

1.1
Location : readShort
Killed by : none
changed conditional boundary → NO_COVERAGE

2.2
Location : readShort
Killed by : none
Replaced bitwise OR with AND → NO_COVERAGE

3.3
Location : readShort
Killed by : none
negated conditional → NO_COVERAGE

375

1.1
Location : readShort
Killed by : none
Replaced Shift Left with Shift Right → NO_COVERAGE

2.2
Location : readShort
Killed by : none
Replaced integer addition with subtraction → NO_COVERAGE

3.3
Location : readShort
Killed by : none
replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE

402

1.1
Location : readShortLE
Killed by : none
changed conditional boundary → NO_COVERAGE

2.2
Location : readShortLE
Killed by : none
Replaced bitwise OR with AND → NO_COVERAGE

3.3
Location : readShortLE
Killed by : none
negated conditional → NO_COVERAGE

404

1.1
Location : readShortLE
Killed by : none
Replaced Shift Left with Shift Right → NO_COVERAGE

2.2
Location : readShortLE
Killed by : none
Replaced Shift Left with Shift Right → NO_COVERAGE

3.3
Location : readShortLE
Killed by : none
Replaced integer addition with subtraction → NO_COVERAGE

4.4
Location : readShortLE
Killed by : none
replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE

410

1.1
Location : readUnsignedShort
Killed by : none
changed conditional boundary → NO_COVERAGE

2.2
Location : readUnsignedShort
Killed by : none
Replaced bitwise OR with AND → NO_COVERAGE

3.3
Location : readUnsignedShort
Killed by : none
negated conditional → NO_COVERAGE

412

1.1
Location : readUnsignedShort
Killed by : none
Replaced Shift Left with Shift Right → NO_COVERAGE

2.2
Location : readUnsignedShort
Killed by : none
Replaced integer addition with subtraction → NO_COVERAGE

3.3
Location : readUnsignedShort
Killed by : none
replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE

439

1.1
Location : readUnsignedShortLE
Killed by : none
changed conditional boundary → NO_COVERAGE

2.2
Location : readUnsignedShortLE
Killed by : none
Replaced bitwise OR with AND → NO_COVERAGE

3.3
Location : readUnsignedShortLE
Killed by : none
negated conditional → NO_COVERAGE

441

1.1
Location : readUnsignedShortLE
Killed by : none
Replaced Shift Left with Shift Right → NO_COVERAGE

2.2
Location : readUnsignedShortLE
Killed by : none
Replaced Shift Left with Shift Right → NO_COVERAGE

3.3
Location : readUnsignedShortLE
Killed by : none
Replaced integer addition with subtraction → NO_COVERAGE

4.4
Location : readUnsignedShortLE
Killed by : none
replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE

447

1.1
Location : readChar
Killed by : none
changed conditional boundary → NO_COVERAGE

2.2
Location : readChar
Killed by : none
Replaced bitwise OR with AND → NO_COVERAGE

3.3
Location : readChar
Killed by : none
negated conditional → NO_COVERAGE

449

1.1
Location : readChar
Killed by : none
Replaced Shift Left with Shift Right → NO_COVERAGE

2.2
Location : readChar
Killed by : none
Replaced integer addition with subtraction → NO_COVERAGE

3.3
Location : readChar
Killed by : none
replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE

475

1.1
Location : readCharLE
Killed by : none
changed conditional boundary → NO_COVERAGE

2.2
Location : readCharLE
Killed by : none
Replaced bitwise OR with AND → NO_COVERAGE

3.3
Location : readCharLE
Killed by : none
negated conditional → NO_COVERAGE

477

1.1
Location : readCharLE
Killed by : none
Replaced Shift Left with Shift Right → NO_COVERAGE

2.2
Location : readCharLE
Killed by : none
Replaced Shift Left with Shift Right → NO_COVERAGE

3.3
Location : readCharLE
Killed by : none
Replaced integer addition with subtraction → NO_COVERAGE

4.4
Location : readCharLE
Killed by : none
replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE

485

1.1
Location : readInt
Killed by : none
changed conditional boundary → NO_COVERAGE

2.2
Location : readInt
Killed by : none
Replaced bitwise OR with AND → NO_COVERAGE

3.3
Location : readInt
Killed by : none
Replaced bitwise OR with AND → NO_COVERAGE

4.4
Location : readInt
Killed by : none
Replaced bitwise OR with AND → NO_COVERAGE

5.5
Location : readInt
Killed by : none
negated conditional → NO_COVERAGE

487

1.1
Location : readInt
Killed by : none
Replaced Shift Left with Shift Right → NO_COVERAGE

2.2
Location : readInt
Killed by : none
Replaced Shift Left with Shift Right → NO_COVERAGE

3.3
Location : readInt
Killed by : none
Replaced integer addition with subtraction → NO_COVERAGE

4.4
Location : readInt
Killed by : none
Replaced Shift Left with Shift Right → NO_COVERAGE

5.5
Location : readInt
Killed by : none
Replaced integer addition with subtraction → NO_COVERAGE

6.6
Location : readInt
Killed by : none
Replaced integer addition with subtraction → NO_COVERAGE

7.7
Location : readInt
Killed by : none
replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE

516

1.1
Location : readIntLE
Killed by : none
changed conditional boundary → NO_COVERAGE

2.2
Location : readIntLE
Killed by : none
Replaced bitwise OR with AND → NO_COVERAGE

3.3
Location : readIntLE
Killed by : none
Replaced bitwise OR with AND → NO_COVERAGE

4.4
Location : readIntLE
Killed by : none
Replaced bitwise OR with AND → NO_COVERAGE

5.5
Location : readIntLE
Killed by : none
negated conditional → NO_COVERAGE

518

1.1
Location : readIntLE
Killed by : none
Replaced Shift Left with Shift Right → NO_COVERAGE

2.2
Location : readIntLE
Killed by : none
Replaced Shift Left with Shift Right → NO_COVERAGE

3.3
Location : readIntLE
Killed by : none
Replaced integer addition with subtraction → NO_COVERAGE

4.4
Location : readIntLE
Killed by : none
Replaced Shift Left with Shift Right → NO_COVERAGE

5.5
Location : readIntLE
Killed by : none
Replaced integer addition with subtraction → NO_COVERAGE

6.6
Location : readIntLE
Killed by : none
Replaced Shift Left with Shift Right → NO_COVERAGE

7.7
Location : readIntLE
Killed by : none
Replaced integer addition with subtraction → NO_COVERAGE

8.8
Location : readIntLE
Killed by : none
replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE

546

1.1
Location : readUnsignedInt
Killed by : none
changed conditional boundary → NO_COVERAGE

2.2
Location : readUnsignedInt
Killed by : none
Replaced bitwise OR with AND → NO_COVERAGE

3.3
Location : readUnsignedInt
Killed by : none
Replaced bitwise OR with AND → NO_COVERAGE

4.4
Location : readUnsignedInt
Killed by : none
Replaced bitwise OR with AND → NO_COVERAGE

5.5
Location : readUnsignedInt
Killed by : none
negated conditional → NO_COVERAGE

548

1.1
Location : readUnsignedInt
Killed by : none
Replaced Shift Left with Shift Right → NO_COVERAGE

2.2
Location : readUnsignedInt
Killed by : none
Replaced Shift Left with Shift Right → NO_COVERAGE

3.3
Location : readUnsignedInt
Killed by : none
Replaced long addition with subtraction → NO_COVERAGE

4.4
Location : readUnsignedInt
Killed by : none
Replaced Shift Left with Shift Right → NO_COVERAGE

5.5
Location : readUnsignedInt
Killed by : none
Replaced long addition with subtraction → NO_COVERAGE

6.6
Location : readUnsignedInt
Killed by : none
Replaced Shift Left with Shift Right → NO_COVERAGE

7.7
Location : readUnsignedInt
Killed by : none
Replaced long addition with subtraction → NO_COVERAGE

8.8
Location : readUnsignedInt
Killed by : none
replaced return of long value with value + 1 for com/lowagie/text/pdf/RandomAccessFileOrArray::readUnsignedInt → NO_COVERAGE

556

1.1
Location : readUnsignedIntLE
Killed by : none
changed conditional boundary → NO_COVERAGE

2.2
Location : readUnsignedIntLE
Killed by : none
Replaced bitwise OR with AND → NO_COVERAGE

3.3
Location : readUnsignedIntLE
Killed by : none
Replaced bitwise OR with AND → NO_COVERAGE

4.4
Location : readUnsignedIntLE
Killed by : none
Replaced bitwise OR with AND → NO_COVERAGE

5.5
Location : readUnsignedIntLE
Killed by : none
negated conditional → NO_COVERAGE

558

1.1
Location : readUnsignedIntLE
Killed by : none
Replaced Shift Left with Shift Right → NO_COVERAGE

2.2
Location : readUnsignedIntLE
Killed by : none
Replaced Shift Left with Shift Right → NO_COVERAGE

3.3
Location : readUnsignedIntLE
Killed by : none
Replaced long addition with subtraction → NO_COVERAGE

4.4
Location : readUnsignedIntLE
Killed by : none
Replaced Shift Left with Shift Right → NO_COVERAGE

5.5
Location : readUnsignedIntLE
Killed by : none
Replaced long addition with subtraction → NO_COVERAGE

6.6
Location : readUnsignedIntLE
Killed by : none
Replaced Shift Left with Shift Right → NO_COVERAGE

7.7
Location : readUnsignedIntLE
Killed by : none
Replaced long addition with subtraction → NO_COVERAGE

8.8
Location : readUnsignedIntLE
Killed by : none
replaced return of long value with value + 1 for com/lowagie/text/pdf/RandomAccessFileOrArray::readUnsignedIntLE → NO_COVERAGE

562

1.1
Location : readLong
Killed by : none
Replaced Shift Left with Shift Right → NO_COVERAGE

2.2
Location : readLong
Killed by : none
Replaced bitwise AND with OR → NO_COVERAGE

3.3
Location : readLong
Killed by : none
Replaced long addition with subtraction → NO_COVERAGE

4.4
Location : readLong
Killed by : none
replaced return of long value with value + 1 for com/lowagie/text/pdf/RandomAccessFileOrArray::readLong → NO_COVERAGE

568

1.1
Location : readLongLE
Killed by : none
Replaced Shift Left with Shift Right → NO_COVERAGE

2.2
Location : readLongLE
Killed by : none
Replaced bitwise AND with OR → NO_COVERAGE

3.3
Location : readLongLE
Killed by : none
Replaced long addition with subtraction → NO_COVERAGE

4.4
Location : readLongLE
Killed by : none
replaced return of long value with value + 1 for com/lowagie/text/pdf/RandomAccessFileOrArray::readLongLE → NO_COVERAGE

572

1.1
Location : readFloat
Killed by : none
replaced return of float value with -(x + 1) for com/lowagie/text/pdf/RandomAccessFileOrArray::readFloat → NO_COVERAGE

576

1.1
Location : readFloatLE
Killed by : none
replaced return of float value with -(x + 1) for com/lowagie/text/pdf/RandomAccessFileOrArray::readFloatLE → NO_COVERAGE

580

1.1
Location : readDouble
Killed by : none
replaced return of double value with -(x + 1) for com/lowagie/text/pdf/RandomAccessFileOrArray::readDouble → NO_COVERAGE

584

1.1
Location : readDoubleLE
Killed by : none
replaced return of double value with -(x + 1) for com/lowagie/text/pdf/RandomAccessFileOrArray::readDoubleLE → NO_COVERAGE

592

1.1
Location : readLine
Killed by : none
negated conditional → NO_COVERAGE

601

1.1
Location : readLine
Killed by : none
negated conditional → NO_COVERAGE

602

1.1
Location : readLine
Killed by : none
removed call to com/lowagie/text/pdf/RandomAccessFileOrArray::seek → NO_COVERAGE

611

1.1
Location : readLine
Killed by : none
negated conditional → NO_COVERAGE

2.2
Location : readLine
Killed by : none
negated conditional → NO_COVERAGE

612

1.1
Location : readLine
Killed by : none
mutated return of Object value for com/lowagie/text/pdf/RandomAccessFileOrArray::readLine to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE

614

1.1
Location : readLine
Killed by : none
mutated return of Object value for com/lowagie/text/pdf/RandomAccessFileOrArray::readLine to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE

618

1.1
Location : readUTF
Killed by : none
mutated return of Object value for com/lowagie/text/pdf/RandomAccessFileOrArray::readUTF to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE

641

1.1
Location : getNioByteBuffer
Killed by : none
negated conditional → NO_COVERAGE

643

1.1
Location : getNioByteBuffer
Killed by : none
negated conditional → NO_COVERAGE

647

1.1
Location : getNioByteBuffer
Killed by : none
mutated return of Object value for com/lowagie/text/pdf/RandomAccessFileOrArray::getNioByteBuffer to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE

649

1.1
Location : getNioByteBuffer
Killed by : none
mutated return of Object value for com/lowagie/text/pdf/RandomAccessFileOrArray::getNioByteBuffer to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE

Active mutators

Tests examined


Report generated by PIT 1.4.2