public class RAIFile extends Object implements RandomAccessInterface, DataInput, DataOutput
Constructor and Description |
---|
RAIFile(File file,
boolean read,
boolean write) |
RAIFile(RandomAccessFile file) |
Modifier and Type | Method and 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
FileNotFoundException
public RAIFile(File file, boolean read, boolean write) throws FileNotFoundException
read
- must be trueFileNotFoundException
public boolean canWrite()
canWrite
in interface RandomAccessInterface
public long getFilePointer() throws IOException
getFilePointer
in interface RandomAccessInterface
IOException
public long length() throws IOException
length
in interface RandomAccessInterface
IOException
public int read() throws IOException
read
in interface RandomAccessInterface
IOException
public int read(byte[] b) throws IOException
read
in interface RandomAccessInterface
IOException
public int read(byte[] b, int off, int len) throws IOException
read
in interface RandomAccessInterface
IOException
public void seek(long pos) throws IOException
seek
in interface RandomAccessInterface
IOException
public void setLength(long newLength) throws IOException
setLength
in interface RandomAccessInterface
IOException
public void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
close
in interface RandomAccessInterface
IOException
public boolean readBoolean() throws IOException
readBoolean
in interface DataInput
readBoolean
in interface RandomAccessInterface
IOException
public byte readByte() throws IOException
readByte
in interface DataInput
readByte
in interface RandomAccessInterface
IOException
public char readChar() throws IOException
readChar
in interface DataInput
readChar
in interface RandomAccessInterface
IOException
public double readDouble() throws IOException
readDouble
in interface DataInput
readDouble
in interface RandomAccessInterface
IOException
public float readFloat() throws IOException
readFloat
in interface DataInput
readFloat
in interface RandomAccessInterface
IOException
public void readFully(byte[] b) throws IOException
readFully
in interface DataInput
readFully
in interface RandomAccessInterface
IOException
public void readFully(byte[] b, int off, int len) throws IOException
readFully
in interface DataInput
readFully
in interface RandomAccessInterface
IOException
public int readInt() throws IOException
readInt
in interface DataInput
readInt
in interface RandomAccessInterface
IOException
public String readLine() throws IOException
readLine
in interface DataInput
readLine
in interface RandomAccessInterface
IOException
public long readLong() throws IOException
readLong
in interface DataInput
readLong
in interface RandomAccessInterface
IOException
public short readShort() throws IOException
readShort
in interface DataInput
readShort
in interface RandomAccessInterface
IOException
public int readUnsignedByte() throws IOException
readUnsignedByte
in interface DataInput
readUnsignedByte
in interface RandomAccessInterface
IOException
public int readUnsignedShort() throws IOException
readUnsignedShort
in interface DataInput
readUnsignedShort
in interface RandomAccessInterface
IOException
public int readUnsignedInt() throws IOException
readUnsignedInt
in interface RandomAccessInterface
IOException
- if the read value is negativepublic String readUTF() throws IOException
readUTF
in interface DataInput
readUTF
in interface RandomAccessInterface
IOException
public int skipBytes(int n) throws IOException
skipBytes
in interface DataInput
skipBytes
in interface RandomAccessInterface
IOException
public void write(int b) throws IOException
write
in interface DataOutput
write
in interface RandomAccessInterface
IOException
public void write(byte[] b) throws IOException
write
in interface DataOutput
write
in interface RandomAccessInterface
IOException
public void write(byte[] b, int off, int len) throws IOException
write
in interface DataOutput
write
in interface RandomAccessInterface
IOException
public void writeBoolean(boolean v) throws IOException
writeBoolean
in interface DataOutput
writeBoolean
in interface RandomAccessInterface
IOException
public void writeByte(int v) throws IOException
writeByte
in interface DataOutput
writeByte
in interface RandomAccessInterface
IOException
public void writeShort(int v) throws IOException
writeShort
in interface DataOutput
writeShort
in interface RandomAccessInterface
IOException
public void writeChar(int v) throws IOException
writeChar
in interface DataOutput
writeChar
in interface RandomAccessInterface
IOException
public void writeInt(int v) throws IOException
writeInt
in interface DataOutput
writeInt
in interface RandomAccessInterface
IOException
public void writeLong(long v) throws IOException
writeLong
in interface DataOutput
writeLong
in interface RandomAccessInterface
IOException
public void writeFloat(float v) throws IOException
writeFloat
in interface DataOutput
writeFloat
in interface RandomAccessInterface
IOException
public void writeDouble(double v) throws IOException
writeDouble
in interface DataOutput
writeDouble
in interface RandomAccessInterface
IOException
public void writeBytes(String s) throws IOException
writeBytes
in interface DataOutput
writeBytes
in interface RandomAccessInterface
IOException
public void writeChars(String s) throws IOException
writeChars
in interface DataOutput
writeChars
in interface RandomAccessInterface
IOException
public void writeUTF(String str) throws IOException
writeUTF
in interface DataOutput
writeUTF
in interface RandomAccessInterface
IOException