|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectch.javasoft.jbase.util.AbstractDataInput
public abstract class AbstractDataInput
The AbstractDataInput class implements most methods of
DataInput, leaving only the following methods for subclasses:
This class is thread safe.
| Constructor Summary | |
|---|---|
AbstractDataInput()
|
|
| Method Summary | |
|---|---|
protected abstract int |
peek()
Like read(), but the value is read again, that is, the position
is not moved forward. |
protected abstract int |
read()
Reads a byte of data from this file. |
protected abstract int |
read(byte[] b,
int off,
int len)
Reads a sub array as a sequence of bytes. |
boolean |
readBoolean()
|
byte |
readByte()
|
char |
readChar()
|
double |
readDouble()
|
float |
readFloat()
|
void |
readFully(byte[] b)
|
void |
readFully(byte[] b,
int off,
int len)
|
int |
readInt()
|
String |
readLine()
Note that this method throws an i/o exception if the peek()
method is not supported. |
long |
readLong()
|
short |
readShort()
|
int |
readUnsignedByte()
|
int |
readUnsignedShort()
|
String |
readUTF()
|
abstract int |
skipBytes(int n)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public AbstractDataInput()
| Method Detail |
|---|
protected abstract int read()
throws IOException
0x00-0x0ff). This
method should block if no input is yet available.
Although AbstractDataInput is not a subclass of
InputStream, this method behaves in exactly the same
way as the InputStream.read() method of
InputStream.
-1 if the end of the
input has been reached.
IOException - if an I/O error occurs. Not thrown if
end-of-file has been reached.
protected abstract int peek()
throws IOException
read(), but the value is read again, that is, the position
is not moved forward. This method is used by readLine(), if
subclasses cannot support this method, an i/o exception should be thrown,
causing that readLine() will also throw an i/o exception.
IOException - if peek operations are not supported
protected abstract int read(byte[] b,
int off,
int len)
throws IOException
b - the buffer into which the data is read.off - the start offset of the data.len - the number of bytes to read.
IOException - If an I/O error has occurred.
public abstract int skipBytes(int n)
throws IOException
skipBytes in interface DataInputIOException
public boolean readBoolean()
throws IOException
readBoolean in interface DataInputIOException
public byte readByte()
throws IOException
readByte in interface DataInputIOException
public char readChar()
throws IOException
readChar in interface DataInputIOException
public double readDouble()
throws IOException
readDouble in interface DataInputIOException
public float readFloat()
throws IOException
readFloat in interface DataInputIOException
public void readFully(byte[] b)
throws IOException
readFully in interface DataInputIOException
public void readFully(byte[] b,
int off,
int len)
throws IOException
readFully in interface DataInputIOException
public int readInt()
throws IOException
readInt in interface DataInputIOException
public String readLine()
throws IOException
peek()
method is not supported.
readLine in interface DataInputIOExceptionpeek(),
DataInput.readLine()
public long readLong()
throws IOException
readLong in interface DataInputIOException
public short readShort()
throws IOException
readShort in interface DataInputIOException
public String readUTF()
throws IOException
readUTF in interface DataInputIOException
public int readUnsignedByte()
throws IOException
readUnsignedByte in interface DataInputIOException
public int readUnsignedShort()
throws IOException
readUnsignedShort in interface DataInputIOException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||