|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.extex.util.file.random.RandomAccessInputFile
public class RandomAccessInputFile
RandomAccess for a File (Input)
| Field Summary |
|---|
| Fields inherited from interface org.extex.util.file.random.RandomAccessR |
|---|
KILL32, X24 |
| Constructor Summary | |
|---|---|
RandomAccessInputFile(java.io.File file)
Create a new object |
|
RandomAccessInputFile(java.lang.String filename)
Create a new object |
|
| Method Summary | |
|---|---|
void |
close()
|
byte[] |
getData()
Returns the data. |
long |
getPointer()
Returns the pointer in the buffer. |
boolean |
isEOF()
Check, if EOF is reached. |
long |
length()
|
int |
read()
Reads a byte of data from this file. |
boolean |
readBoolean()
|
byte |
readByte()
|
int |
readByteAsInt()
Reads a byte of data from this file. |
char |
readChar()
Reads a Unicode character from the input. |
double |
readDouble()
Reads a double from the input. |
float |
readFloat()
Reads a float from the input. |
void |
readFully(byte[] b)
|
void |
readFully(byte[] b,
int off,
int len)
|
int |
readInt()
Reads a signed 32-bit integer from the input. |
int |
readInt16()
Reads a int with 16 bit (2x8). |
int |
readInt24()
Reads a signed 24-bit integer from the input. |
int |
readInt8()
Reads a int with 8 bit (1x8). |
java.lang.String |
readLine()
Reads the next line of text from the input. |
long |
readLong()
Reads a signed 64-bit integer from the input. |
short |
readShort()
Reads a signed 16-bit number from the input. |
int |
readSignInt24()
Reads a sign int with 24 bit (3x8). |
int |
readUnsignedByte()
Reads an unsigned eight-bit number from the input. |
int |
readUnsignedShort()
Reads an unsigned 16-bit number from the input. |
java.lang.String |
readUTF()
Reads in a string from this file. |
void |
seek(long arg0)
|
int |
skipBytes(int n)
Attempts to skip over n bytes of input discarding the
skipped bytes. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public RandomAccessInputFile(java.io.File file)
throws java.io.IOException
file - file for reading
java.io.IOException - if an IO-error occured
public RandomAccessInputFile(java.lang.String filename)
throws java.io.IOException
filename - filename for reading
java.io.IOException - if an IO-error occured| Method Detail |
|---|
public void close()
throws java.io.IOException
close in interface RandomAccessRjava.io.IOExceptionRandomAccessR.close()
public byte[] getData()
throws java.io.IOException
getData in interface RandomAccessRjava.io.IOExceptionRandomAccessR.getData()
public long getPointer()
throws java.io.IOException
getPointer in interface RandomAccessRjava.io.IOException - if an IO error occursRandomAccessR.getPointer()
public boolean isEOF()
throws java.io.IOException
isEOF in interface RandomAccessRtrue, if EOF is reached.
java.io.IOException - if an IO error occurs.RandomAccessR.isEOF()
public long length()
throws java.io.IOException
length in interface RandomAccessRjava.io.IOExceptionRandomAccessR.length()
public int read()
throws java.io.IOException
0x00-0x0ff).
-1 if the end of the
file has been reached.
java.io.IOException - if an IO-error occurs.
public boolean readBoolean()
throws java.io.IOException
readBoolean in interface java.io.DataInputjava.io.IOExceptionDataInput.readBoolean()
public byte readByte()
throws java.io.IOException
readByte in interface java.io.DataInputjava.io.IOExceptionDataInput.readByte()
public int readByteAsInt()
throws java.io.IOException
0x00-0x0ff).
readByteAsInt in interface RandomAccessRjava.io.IOException - if an IO error occurs.RandomAccessR.readByteAsInt()
public char readChar()
throws java.io.IOException
b1 and b2,
where 0 <= b1, b2 <= 255,
then the result is equal to:
(char)((b1 << 8) | b2)
readChar in interface java.io.DataInputjava.io.IOExceptionDataInput.readChar()
public double readDouble()
throws java.io.IOException
double from the input.
readDouble in interface java.io.DataInputjava.io.IOExceptionDataInput.readDouble()
public float readFloat()
throws java.io.IOException
float from the input.
readFloat in interface java.io.DataInputjava.io.IOExceptionDataInput.readFloat()
public void readFully(byte[] b)
throws java.io.IOException
readFully in interface java.io.DataInputjava.io.IOExceptionDataInput.readFully(byte[])
public void readFully(byte[] b,
int off,
int len)
throws java.io.IOException
readFully in interface java.io.DataInputjava.io.IOExceptionDataInput.readFully(byte[], int, int)
public int readInt()
throws java.io.IOException
b1, b2,
b3, and b4, where
0 <= b1, b2, b3, b4 <= 255,
then the result is equal to:
(b1 << 24) | (b2 << 16) + (b3 << 8) + b4
readInt in interface java.io.DataInputjava.io.IOExceptionDataInput.readInt()
public int readInt16()
throws java.io.IOException
readInt16 in interface RandomAccessRjava.io.IOException - if an IO error occurs.RandomAccessR.readInt16()
public int readInt24()
throws java.io.IOException
b1, b2,
and b3, where
0 <= b1, b2, b3 <= 255, then
the result is equal to:
(b1 << 16) + (b2 << 8) + b3
Reads a int with 24 bit (3x8).
readInt24 in interface RandomAccessRjava.io.IOException - if an IO error occurs.DataInput.readInt()
public int readInt8()
throws java.io.IOException
readInt8 in interface RandomAccessRjava.io.IOException - if an IO error occurs.RandomAccessR.readInt8()
public java.lang.String readLine()
throws java.io.IOException
readLine in interface java.io.DataInputjava.io.IOExceptionDataInput.readLine()
public long readLong()
throws java.io.IOException
b1, b2,
b3, b4, b5,
b6, b7, and b8, where:
0 <= b1, b2, b3, b4, b5, b6, b7, b8 <=255,
then the result is equal to:
((long)b1 << 56) + ((long)b2 << 48)
+ ((long)b3 << 40) + ((long)b4 << 32)
+ ((long)b5 << 24) + ((long)b6 << 16)
+ ((long)b7 << 8) + b8
readLong in interface java.io.DataInputjava.io.IOExceptionDataInput.readLong()
public short readShort()
throws java.io.IOException
b1 and
b2, where each of the two values is between
0 and 255, inclusive, then the result is
equal to:
(short)((b1 << 8) | b2)
readShort in interface java.io.DataInputjava.io.IOExceptionDataInput.readShort()
public int readSignInt24()
throws java.io.IOException
readSignInt24 in interface RandomAccessRjava.io.IOException - if an IO error occurs.RandomAccessR.readSignInt24()
public int readUnsignedByte()
throws java.io.IOException
readUnsignedByte in interface java.io.DataInputjava.io.IOExceptionDataInput.readUnsignedByte()
public int readUnsignedShort()
throws java.io.IOException
b1 and b2,
where 0 <= b1, b2 <= 255, then
the result is equal to:
(b1 << 8) | b2
readUnsignedShort in interface java.io.DataInputjava.io.IOExceptionDataInput.readUnsignedShort()
public java.lang.String readUTF()
throws java.io.IOException
readUTF in interface java.io.DataInputjava.io.IOExceptionDataInput.readUTF()
public void seek(long arg0)
throws java.io.IOException
seek in interface RandomAccessRjava.io.IOExceptionRandomAccessR.seek(long)
public int skipBytes(int n)
throws java.io.IOException
n bytes of input discarding the
skipped bytes.
skipBytes in interface java.io.DataInputjava.io.IOExceptionDataInput.skipBytes(int)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||