01: // kelondroIOChunks.java
02: // -----------------------
03: // part of The Kelondro Database
04: // (C) by Michael Peter Christen; mc@anomic.de
05: // first published on http://www.anomic.de
06: // Frankfurt, Germany, 2005
07: // created: 11.12.2005
08: //
09: // This program is free software; you can redistribute it and/or modify
10: // it under the terms of the GNU General Public License as published by
11: // the Free Software Foundation; either version 2 of the License, or
12: // (at your option) any later version.
13: //
14: // This program is distributed in the hope that it will be useful,
15: // but WITHOUT ANY WARRANTY; without even the implied warranty of
16: // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17: // GNU General Public License for more details.
18: //
19: // You should have received a copy of the GNU General Public License
20: // along with this program; if not, write to the Free Software
21: // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22: //
23: // Using this software in any meaning (reading, learning, copying, compiling,
24: // running) means that you agree that the Author(s) is (are) not responsible
25: // for cost, loss of data or any harm that may be caused directly or indirectly
26: // by usage of this softare or this documentation. The usage of this software
27: // is on your own risk. The installation and usage (starting/running) of this
28: // software may allow other people or application to access your computer and
29: // any attached devices and is highly dependent on the configuration of the
30: // software which must be done by the user of the software; the author(s) is
31: // (are) also not responsible for proper configuration and usage of the
32: // software, even if provoked by documentation provided together with
33: // the software.
34: //
35: // Any changes to this file according to the GPL as documented in the file
36: // gpl.txt aside this file in the shipment you received can be done to the
37: // lines that follows this copyright notice here, but changes must not be
38: // done inside the copyright notive above. A re-distribution must contain
39: // the intact and unchanged copyright notice.
40: // Contributions and changes to the program code must be marked as such.
41:
42: package de.anomic.kelondro;
43:
44: import java.io.IOException;
45:
46: public interface kelondroIOChunks {
47:
48: // logging support
49: public String name();
50:
51: // reference handling
52: public kelondroRA getRA();
53:
54: // pseudo-native methods:
55: public long length() throws IOException;
56:
57: public int read(long pos, byte[] b, int off, int len)
58: throws IOException;
59:
60: public void write(long pos, byte[] b, int off, int len)
61: throws IOException;
62:
63: public void commit() throws IOException;
64:
65: public void close() throws IOException;
66:
67: // derived methods:
68: public void readFully(long pos, byte[] b, int off, int len)
69: throws IOException;
70:
71: public byte readByte(long pos) throws IOException;
72:
73: public void writeByte(long pos, int v) throws IOException;
74:
75: public short readShort(long pos) throws IOException;
76:
77: public void writeShort(long pos, int v) throws IOException;
78:
79: public int readInt(long pos) throws IOException;
80:
81: public void writeInt(long pos, int v) throws IOException;
82:
83: public long readLong(long pos) throws IOException;
84:
85: public void writeLong(long pos, long v) throws IOException;
86:
87: public void write(long pos, byte[] b) throws IOException;
88:
89: public kelondroProfile profile();
90: }
|