EMMA Coverage Report (generated Wed Jun 27 17:43:42 CEST 2012)
[all classes][aarddict]

COVERAGE SUMMARY FOR SOURCE FILE [RandomAccessFile.java]

nameclass, %method, %block, %line, %
RandomAccessFile.java100% (1/1)71%  (5/7)39%  (86/219)46%  (19/41)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class RandomAccessFile100% (1/1)71%  (5/7)39%  (86/219)46%  (19/41)
RandomAccessFile (String, String): void 0%   (0/1)0%   (0/5)0%   (0/2)
readUnsignedLong (): long 0%   (0/1)0%   (0/86)0%   (0/11)
readSpec (char): long 100% (1/1)33%  (19/57)38%  (5/13)
readUnsignedInt (): long 100% (1/1)91%  (42/46)86%  (6/7)
RandomAccessFile (File, String): void 100% (1/1)100% (5/5)100% (2/2)
readUTF8 (int): String 100% (1/1)100% (10/10)100% (3/3)
readUUID (): UUID 100% (1/1)100% (10/10)100% (3/3)

1/* This file is part of Aard Dictionary for Android <http://aarddict.org>.
2 * 
3 * This program is free software: you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License version 3
5 * as published by the Free Software Foundation.
6 *
7 * This program is distributed in the hope that it will be useful,
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
10 * GNU General Public License <http://www.gnu.org/licenses/gpl-3.0.txt>
11 * for more details.
12 * 
13 * Copyright (C) 2010 Igor Tkach
14*/
15 
16package aarddict;
17 
18import java.io.EOFException;
19import java.io.File;
20import java.io.FileNotFoundException;
21import java.io.IOException;
22import java.util.UUID;
23 
24final class RandomAccessFile extends java.io.RandomAccessFile {
25 
26    public RandomAccessFile(File file, String mode) throws FileNotFoundException {
27        super(file, mode);
28    }
29 
30    public RandomAccessFile(String fileName, String mode) throws FileNotFoundException {
31        super(fileName, mode);
32    }
33    
34    public final long readUnsignedInt() throws IOException {
35        int ch1 = this.read();
36        int ch2 = this.read();
37        int ch3 = this.read();
38        int ch4 = this.read();
39        if ((ch1 | ch2 | ch3 | ch4) < 0)
40            throw new EOFException();
41        return ((long) (ch1 << 24) + (ch2 << 16) + (ch3 << 8) + (ch4 << 0)) & 0xFFFFFFFFL;
42    }
43 
44    public final long readUnsignedLong() throws IOException {
45        int ch1 = this.read();
46        int ch2 = this.read();
47        int ch3 = this.read();
48        int ch4 = this.read();
49        int ch5 = this.read();
50        int ch6 = this.read();
51        int ch7 = this.read();
52        int ch8 = this.read();
53        if ((ch1 | ch2 | ch3 | ch4 | ch5 | ch6 | ch7 | ch8) < 0)
54            throw new EOFException();
55        return ((long) (ch1 << 56) + (ch2 << 48) + (ch3 << 40) + (ch4 << 32) + (ch5 << 24) + (ch6 << 16) + (ch7 << 8) + (ch8 << 0)) & 0xFFFFFFFFFFFFFFFFL;
56    }
57    
58    public final String readUTF8(int length) throws IOException {
59        byte[] s = new byte[length];
60        this.read(s);
61        return Volume.utf8(s);
62    }
63 
64    public final UUID readUUID() throws IOException {
65        byte[] s = new byte[16];
66        this.read(s);
67        return Volume.uuid(s);
68    }
69    
70    public final long readSpec(char spec) throws IOException {
71        if (spec == 'L' || spec == 'I') {
72            return readUnsignedInt();
73        }
74        if (spec == 'Q') {
75            return readUnsignedLong();
76        }
77        if (spec == 'H') {
78            return readUnsignedShort();
79        }
80        if (spec == 'l' || spec == 'i') {
81            return readInt();
82        }
83        if (spec == 'q') {
84            return readLong();
85        }
86        if (spec == 'h') {
87            return this.readShort();
88        }
89        throw new IOException("Unsupported spec character " + spec);
90    }
91 
92}

[all classes][aarddict]
EMMA 0.0.0 (unsupported private build) (C) Vladimir Roubtsov