EMMA Coverage Report (generated Sun Mar 01 22:06:14 CET 2015)
[all classes][org.h2.store.fs]

COVERAGE SUMMARY FOR SOURCE FILE [FileBase.java]

nameclass, %method, %block, %line, %
FileBase.java100% (1/1)75%  (9/12)91%  (61/67)85%  (17/20)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class FileBase100% (1/1)75%  (9/12)91%  (61/67)85%  (17/20)
force (boolean): void 0%   (0/1)0%   (0/1)0%   (0/1)
implCloseChannel (): void 0%   (0/1)0%   (0/1)0%   (0/1)
tryLock (long, long, boolean): FileLock 0%   (0/1)0%   (0/4)0%   (0/1)
FileBase (): void 100% (1/1)100% (3/3)100% (1/1)
lock (long, long, boolean): FileLock 100% (1/1)100% (4/4)100% (1/1)
map (FileChannel$MapMode, long, long): MappedByteBuffer 100% (1/1)100% (4/4)100% (1/1)
read (ByteBuffer [], int, int): long 100% (1/1)100% (4/4)100% (1/1)
read (ByteBuffer, long): int 100% (1/1)100% (17/17)100% (5/5)
transferFrom (ReadableByteChannel, long, long): long 100% (1/1)100% (4/4)100% (1/1)
transferTo (long, long, WritableByteChannel): long 100% (1/1)100% (4/4)100% (1/1)
write (ByteBuffer [], int, int): long 100% (1/1)100% (4/4)100% (1/1)
write (ByteBuffer, long): int 100% (1/1)100% (17/17)100% (5/5)

1/*
2 * Copyright 2004-2014 H2 Group. Multiple-Licensed under the MPL 2.0,
3 * and the EPL 1.0 (http://h2database.com/html/license.html).
4 * Initial Developer: H2 Group
5 */
6package org.h2.store.fs;
7 
8import java.io.IOException;
9import java.nio.ByteBuffer;
10import java.nio.MappedByteBuffer;
11import java.nio.channels.FileChannel;
12import java.nio.channels.FileLock;
13import java.nio.channels.ReadableByteChannel;
14import java.nio.channels.WritableByteChannel;
15 
16/**
17 * The base class for file implementations.
18 */
19public abstract class FileBase extends FileChannel {
20 
21    @Override
22    public abstract long size() throws IOException;
23 
24    @Override
25    public abstract long position() throws IOException;
26 
27    @Override
28    public abstract FileChannel position(long newPosition) throws IOException;
29 
30    @Override
31    public abstract int read(ByteBuffer dst) throws IOException;
32 
33    @Override
34    public abstract int write(ByteBuffer src) throws IOException;
35 
36    @Override
37    public synchronized int read(ByteBuffer dst, long position)
38            throws IOException {
39        long oldPos = position();
40        position(position);
41        int len = read(dst);
42        position(oldPos);
43        return len;
44    }
45 
46    @Override
47    public synchronized int write(ByteBuffer src, long position)
48            throws IOException {
49        long oldPos = position();
50        position(position);
51        int len = write(src);
52        position(oldPos);
53        return len;
54    }
55 
56    @Override
57    public abstract FileChannel truncate(long size) throws IOException;
58 
59    @Override
60    public void force(boolean metaData) throws IOException {
61        // ignore
62    }
63 
64    @Override
65    protected void implCloseChannel() throws IOException {
66        // ignore
67    }
68 
69    @Override
70    public FileLock lock(long position, long size, boolean shared)
71            throws IOException {
72        throw new UnsupportedOperationException();
73    }
74 
75    @Override
76    public MappedByteBuffer map(MapMode mode, long position, long size)
77            throws IOException {
78        throw new UnsupportedOperationException();
79    }
80 
81    @Override
82    public long read(ByteBuffer[] dsts, int offset, int length)
83            throws IOException {
84        throw new UnsupportedOperationException();
85    }
86 
87    @Override
88    public long transferFrom(ReadableByteChannel src, long position, long count)
89            throws IOException {
90        throw new UnsupportedOperationException();
91    }
92 
93    @Override
94    public long transferTo(long position, long count, WritableByteChannel target)
95            throws IOException {
96        throw new UnsupportedOperationException();
97    }
98 
99    @Override
100    public FileLock tryLock(long position, long size, boolean shared)
101            throws IOException {
102        throw new UnsupportedOperationException();
103    }
104 
105    @Override
106    public long write(ByteBuffer[] srcs, int offset, int length)
107            throws IOException {
108        throw new UnsupportedOperationException();
109    }
110 
111}

[all classes][org.h2.store.fs]
EMMA 2.0.5312 (C) Vladimir Roubtsov