Closeable, DataInput, DataOutput, AutoCloseable, RandomAccessInterfacepublic class RAIFile extends Object implements RandomAccessInterface, DataInput, DataOutput
| Constructor | Description |
|---|---|
RAIFile(File file,
boolean read,
boolean write) |
|
RAIFile(RandomAccessFile file) |
| Modifier and Type | Method | Description |
|---|---|---|
boolean |
canWrite() |
I2P is the file writable?
Only valid if the File constructor was used, not the RAF constructor
|
void |
close() |
|
long |
getFilePointer() |
|
long |
length() |
|
int |
read() |
|
int |
read(byte[] b) |
|
int |
read(byte[] b,
int off,
int len) |
|
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() |
|
long |
readLong() |
|
short |
readShort() |
|
int |
readUnsignedByte() |
|
int |
readUnsignedInt() |
I2P
|
int |
readUnsignedShort() |
|
String |
readUTF() |
Read a UTF encoded string
I would delegate here.
|
void |
seek(long pos) |
|
void |
setLength(long newLength) |
|
int |
skipBytes(int n) |
|
String |
toString() |
|
void |
write(byte[] b) |
|
void |
write(byte[] b,
int off,
int len) |
|
void |
write(int b) |
|
void |
writeBoolean(boolean v) |
|
void |
writeByte(int v) |
|
void |
writeBytes(String s) |
|
void |
writeChar(int v) |
|
void |
writeChars(String s) |
|
void |
writeDouble(double v) |
|
void |
writeFloat(float v) |
|
void |
writeInt(int v) |
|
void |
writeLong(long v) |
|
void |
writeShort(int v) |
|
void |
writeUTF(String str) |
Write a UTF encoded string
I would delegate here.
|
public RAIFile(RandomAccessFile file) throws FileNotFoundException
FileNotFoundExceptionpublic RAIFile(File file, boolean read, boolean write) throws FileNotFoundException
read - must be trueFileNotFoundExceptionpublic boolean canWrite()
canWrite in interface RandomAccessInterfacepublic long getFilePointer()
throws IOException
getFilePointer in interface RandomAccessInterfaceIOExceptionpublic long length()
throws IOException
length in interface RandomAccessInterfaceIOExceptionpublic int read()
throws IOException
read in interface RandomAccessInterfaceIOExceptionpublic int read(byte[] b)
throws IOException
read in interface RandomAccessInterfaceIOExceptionpublic int read(byte[] b,
int off,
int len)
throws IOException
read in interface RandomAccessInterfaceIOExceptionpublic void seek(long pos)
throws IOException
seek in interface RandomAccessInterfaceIOExceptionpublic void setLength(long newLength)
throws IOException
setLength in interface RandomAccessInterfaceIOExceptionpublic void close()
throws IOException
close in interface AutoCloseableclose in interface Closeableclose in interface RandomAccessInterfaceIOExceptionpublic boolean readBoolean()
throws IOException
readBoolean in interface DataInputreadBoolean in interface RandomAccessInterfaceIOExceptionpublic byte readByte()
throws IOException
readByte in interface DataInputreadByte in interface RandomAccessInterfaceIOExceptionpublic char readChar()
throws IOException
readChar in interface DataInputreadChar in interface RandomAccessInterfaceIOExceptionpublic double readDouble()
throws IOException
readDouble in interface DataInputreadDouble in interface RandomAccessInterfaceIOExceptionpublic float readFloat()
throws IOException
readFloat in interface DataInputreadFloat in interface RandomAccessInterfaceIOExceptionpublic void readFully(byte[] b)
throws IOException
readFully in interface DataInputreadFully in interface RandomAccessInterfaceIOExceptionpublic void readFully(byte[] b,
int off,
int len)
throws IOException
readFully in interface DataInputreadFully in interface RandomAccessInterfaceIOExceptionpublic int readInt()
throws IOException
readInt in interface DataInputreadInt in interface RandomAccessInterfaceIOExceptionpublic String readLine() throws IOException
readLine in interface DataInputreadLine in interface RandomAccessInterfaceIOExceptionpublic long readLong()
throws IOException
readLong in interface DataInputreadLong in interface RandomAccessInterfaceIOExceptionpublic short readShort()
throws IOException
readShort in interface DataInputreadShort in interface RandomAccessInterfaceIOExceptionpublic int readUnsignedByte()
throws IOException
readUnsignedByte in interface DataInputreadUnsignedByte in interface RandomAccessInterfaceIOExceptionpublic int readUnsignedShort()
throws IOException
readUnsignedShort in interface DataInputreadUnsignedShort in interface RandomAccessInterfaceIOExceptionpublic int readUnsignedInt()
throws IOException
readUnsignedInt in interface RandomAccessInterfaceIOException - if the read value is negativepublic String readUTF() throws IOException
readUTF in interface DataInputreadUTF in interface RandomAccessInterfaceIOExceptionpublic int skipBytes(int n)
throws IOException
skipBytes in interface DataInputskipBytes in interface RandomAccessInterfaceIOExceptionpublic void write(int b)
throws IOException
write in interface DataOutputwrite in interface RandomAccessInterfaceIOExceptionpublic void write(byte[] b)
throws IOException
write in interface DataOutputwrite in interface RandomAccessInterfaceIOExceptionpublic void write(byte[] b,
int off,
int len)
throws IOException
write in interface DataOutputwrite in interface RandomAccessInterfaceIOExceptionpublic void writeBoolean(boolean v)
throws IOException
writeBoolean in interface DataOutputwriteBoolean in interface RandomAccessInterfaceIOExceptionpublic void writeByte(int v)
throws IOException
writeByte in interface DataOutputwriteByte in interface RandomAccessInterfaceIOExceptionpublic void writeShort(int v)
throws IOException
writeShort in interface DataOutputwriteShort in interface RandomAccessInterfaceIOExceptionpublic void writeChar(int v)
throws IOException
writeChar in interface DataOutputwriteChar in interface RandomAccessInterfaceIOExceptionpublic void writeInt(int v)
throws IOException
writeInt in interface DataOutputwriteInt in interface RandomAccessInterfaceIOExceptionpublic void writeLong(long v)
throws IOException
writeLong in interface DataOutputwriteLong in interface RandomAccessInterfaceIOExceptionpublic void writeFloat(float v)
throws IOException
writeFloat in interface DataOutputwriteFloat in interface RandomAccessInterfaceIOExceptionpublic void writeDouble(double v)
throws IOException
writeDouble in interface DataOutputwriteDouble in interface RandomAccessInterfaceIOExceptionpublic void writeBytes(String s) throws IOException
writeBytes in interface DataOutputwriteBytes in interface RandomAccessInterfaceIOExceptionpublic void writeChars(String s) throws IOException
writeChars in interface DataOutputwriteChars in interface RandomAccessInterfaceIOExceptionpublic void writeUTF(String str) throws IOException
writeUTF in interface DataOutputwriteUTF in interface RandomAccessInterfaceIOException