KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > net > metanotion > io > RandomAccessInterface


1 /*
2 Copyright (c) 2006, Matthew Estes
3 All rights reserved.
4
5 Redistribution and use in source and binary forms, with or without
6 modification, are permitted provided that the following conditions are met:
7
8     * Redistributions of source code must retain the above copyright
9 notice, this list of conditions and the following disclaimer.
10     * Redistributions in binary form must reproduce the above copyright
11 notice, this list of conditions and the following disclaimer in the
12 documentation and/or other materials provided with the distribution.
13     * Neither the name of Metanotion Software nor the names of its
14 contributors may be used to endorse or promote products derived from this
15 software without specific prior written permission.
16
17 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
18 IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
19 THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
20 PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
21 CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
22 EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
23 PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
24 PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
25 LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
26 NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
27 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 */

29 package net.metanotion.io;
30
31 import java.io.IOException JavaDoc;
32
33 public interface RandomAccessInterface {
34     public long getFilePointer() throws IOException JavaDoc;
35     public long length() throws IOException JavaDoc;
36     public int read() throws IOException JavaDoc;
37     public int read(byte[] b) throws IOException JavaDoc;
38     public int read(byte[] b, int off, int len) throws IOException JavaDoc;
39     public void seek(long pos) throws IOException JavaDoc;
40     public void setLength(long newLength) throws IOException JavaDoc;
41
42     // Closeable Methods
43
public void close() throws IOException JavaDoc;
44
45     // DataInput Methods
46
public boolean readBoolean() throws IOException JavaDoc;
47     public byte readByte() throws IOException JavaDoc;
48     public char readChar() throws IOException JavaDoc;
49     public double readDouble() throws IOException JavaDoc;
50     public float readFloat() throws IOException JavaDoc;
51     public void readFully(byte[] b) throws IOException JavaDoc;
52     public void readFully(byte[] b, int off, int len) throws IOException JavaDoc;
53     public int readInt() throws IOException JavaDoc;
54     public String JavaDoc readLine() throws IOException JavaDoc;
55     public long readLong() throws IOException JavaDoc;
56     public short readShort() throws IOException JavaDoc;
57     public int readUnsignedByte() throws IOException JavaDoc;
58     public int readUnsignedShort() throws IOException JavaDoc;
59     public String JavaDoc readUTF() throws IOException JavaDoc;
60     public int skipBytes(int n) throws IOException JavaDoc;
61
62     // DataOutput Methods
63
public void write(int b) throws IOException JavaDoc;
64     public void write(byte[] b) throws IOException JavaDoc;
65     public void write(byte[] b, int off, int len) throws IOException JavaDoc;
66     public void writeBoolean(boolean v) throws IOException JavaDoc;
67     public void writeByte(int v) throws IOException JavaDoc;
68     public void writeShort(int v) throws IOException JavaDoc;
69     public void writeChar(int v) throws IOException JavaDoc;
70     public void writeInt(int v) throws IOException JavaDoc;
71     public void writeLong(long v) throws IOException JavaDoc;
72     public void writeFloat(float v) throws IOException JavaDoc;
73     public void writeDouble(double v) throws IOException JavaDoc;
74     public void writeBytes(String JavaDoc s) throws IOException JavaDoc;
75     public void writeChars(String JavaDoc s) throws IOException JavaDoc;
76     public void writeUTF(String JavaDoc str) throws IOException JavaDoc;
77 }
78
Popular Tags