public interface RandomAccessService extends java.io.Closeable, Remote
RafToRas
or another proper implementation of this
interface to provide access to a random access file or to a similar data
storage.Modifier and Type | Method and Description |
---|---|
void |
close() |
static RandomAccessService |
convert(java.io.RandomAccessFile raf)
Converts a
RandomAccessFile to a remote RandomAccessService . |
long |
length()
Same as
RandomAccessFile.length() . |
boolean |
readBoolean()
Same as
RandomAccessFile.readBoolean() . |
byte |
readByte()
Same as
RandomAccessFile.readByte() . |
char |
readChar()
Same as
RandomAccessFile.readChar() . |
double |
readDouble()
Same as
RandomAccessFile.readDouble() . |
float |
readFloat()
Same as
RandomAccessFile.readFloat() . |
byte[] |
readFully(int len)
Same as
RandomAccessFile.readFully(byte[], int, int) but construct
the byte[] result itself, instead of taking it as a parameter. |
int |
readInt()
Same as
RandomAccessFile.readInt() . |
java.lang.String |
readLine()
Same as
RandomAccessFile.readLine() . |
long |
readLong()
Same as
RandomAccessFile.readLong() . |
short |
readShort()
Same as
RandomAccessFile.readShort() . |
int |
readUnsignedByte()
Same as
RandomAccessFile.readUnsignedByte() . |
int |
readUnsignedShort()
Same as
RandomAccessFile.readUnsignedShort() . |
java.lang.String |
readUTF()
Same as
RandomAccessFile.readUTF() . |
void |
seek(long pos)
Same as
RandomAccessFile.seek(long) . |
void |
setLength(long newLength)
Same as
RandomAccessFile.setLength(long) . |
int |
skipBytes(int n)
Same as
RandomAccessFile.skipBytes(int) . |
void |
write(byte[] b)
Same as
RandomAccessFile.write(byte[]) . |
void |
write(int b)
Same as
RandomAccessFile.write(int) . |
void |
writeBoolean(boolean v)
Same as
RandomAccessFile.writeBoolean(boolean) . |
void |
writeByte(int v)
Same as
RandomAccessFile.writeByte(int) . |
void |
writeBytes(java.lang.String s)
Same as
RandomAccessFile.writeBytes(String) . |
void |
writeChar(int v)
Same as
RandomAccessFile.writeChar(int) . |
void |
writeChars(java.lang.String s)
Same as
RandomAccessFile.writeChars(String) . |
void |
writeDouble(double v)
Same as
RandomAccessFile.writeDouble(double) . |
void |
writeFloat(float v)
Same as
RandomAccessFile.writeFloat(float) . |
void |
writeInt(int v)
Same as
RandomAccessFile.writeInt(int) . |
void |
writeLong(long v)
Same as
RandomAccessFile.writeLong(long) . |
void |
writeShort(int v)
Same as
RandomAccessFile.writeShort(int) . |
void |
writeUTF(java.lang.String s)
Same as
RandomAccessFile.writeUTF(String) . |
static RandomAccessService convert(java.io.RandomAccessFile raf)
RandomAccessFile
to a remote RandomAccessService
.raf
- the RandomAccessFile
to convertRandomAccessService
that wraps the given
RandomAccessFile
instancebyte[] readFully(int len) throws java.io.IOException, RemoteException
RandomAccessFile.readFully(byte[], int, int)
but construct
the byte[] result itself, instead of taking it as a parameter.len
- the max number of bytes to readjava.io.IOException
- if an I/O error occurs.RemoteException
- if a RMI failure occursint skipBytes(int n) throws java.io.IOException, RemoteException
RandomAccessFile.skipBytes(int)
.n
- the number of bytes to be skipped.java.io.IOException
- if an I/O error occurs.RemoteException
- if a RMI failure occursboolean readBoolean() throws java.io.IOException, RemoteException
RandomAccessFile.readBoolean()
.java.io.IOException
- if an I/O error occurs.RemoteException
- if a RMI failure occursbyte readByte() throws java.io.IOException, RemoteException
RandomAccessFile.readByte()
.java.io.IOException
- if an I/O error occurs.RemoteException
- if a RMI failure occursint readUnsignedByte() throws java.io.IOException, RemoteException
RandomAccessFile.readUnsignedByte()
.java.io.IOException
- if an I/O error occurs.RemoteException
- if a RMI failure occursshort readShort() throws java.io.IOException, RemoteException
RandomAccessFile.readShort()
.java.io.IOException
- if an I/O error occurs.RemoteException
- if a RMI failure occursint readUnsignedShort() throws java.io.IOException, RemoteException
RandomAccessFile.readUnsignedShort()
.java.io.IOException
- if an I/O error occurs.RemoteException
- if a RMI failure occurschar readChar() throws java.io.IOException, RemoteException
RandomAccessFile.readChar()
.java.io.IOException
- if an I/O error occurs.RemoteException
- if a RMI failure occursint readInt() throws java.io.IOException, RemoteException
RandomAccessFile.readInt()
.java.io.IOException
- if an I/O error occurs.RemoteException
- if a RMI failure occurslong readLong() throws java.io.IOException, RemoteException
RandomAccessFile.readLong()
.java.io.IOException
- if an I/O error occurs.RemoteException
- if a RMI failure occursfloat readFloat() throws java.io.IOException, RemoteException
RandomAccessFile.readFloat()
.java.io.IOException
- if an I/O error occurs.RemoteException
- if a RMI failure occursdouble readDouble() throws java.io.IOException, RemoteException
RandomAccessFile.readDouble()
.java.io.IOException
- if an I/O error occurs.RemoteException
- if a RMI failure occursjava.lang.String readLine() throws java.io.IOException, RemoteException
RandomAccessFile.readLine()
.java.io.IOException
- if an I/O error occurs.RemoteException
- if a RMI failure occursjava.lang.String readUTF() throws java.io.IOException, RemoteException
RandomAccessFile.readUTF()
.java.io.IOException
- if an I/O error occurs.RemoteException
- if a RMI failure occursvoid write(int b) throws java.io.IOException, RemoteException
RandomAccessFile.write(int)
.b
- the byte to writejava.io.IOException
- if an I/O error occurs.RemoteException
- if a RMI failure occursvoid write(byte[] b) throws java.io.IOException, RemoteException
RandomAccessFile.write(byte[])
.b
- the bytes to writejava.io.IOException
- if an I/O error occurs.RemoteException
- if a RMI failure occursvoid writeBoolean(boolean v) throws java.io.IOException, RemoteException
RandomAccessFile.writeBoolean(boolean)
.v
- the value to writejava.io.IOException
- if an I/O error occurs.RemoteException
- if a RMI failure occursvoid writeByte(int v) throws java.io.IOException, RemoteException
RandomAccessFile.writeByte(int)
.v
- the value to writejava.io.IOException
- if an I/O error occurs.RemoteException
- if a RMI failure occursvoid writeShort(int v) throws java.io.IOException, RemoteException
RandomAccessFile.writeShort(int)
.v
- the value to writejava.io.IOException
- if an I/O error occurs.RemoteException
- if a RMI failure occursvoid writeChar(int v) throws java.io.IOException, RemoteException
RandomAccessFile.writeChar(int)
.v
- the integer to writejava.io.IOException
- if an I/O error occurs.RemoteException
- if a RMI failure occursvoid writeInt(int v) throws java.io.IOException, RemoteException
RandomAccessFile.writeInt(int)
.v
- the integer to writejava.io.IOException
- if an I/O error occurs.RemoteException
- if a RMI failure occursvoid writeLong(long v) throws java.io.IOException, RemoteException
RandomAccessFile.writeLong(long)
.v
- the integer to writejava.io.IOException
- if an I/O error occurs.RemoteException
- if a RMI failure occursvoid writeFloat(float v) throws java.io.IOException, RemoteException
RandomAccessFile.writeFloat(float)
.v
- the integer to writejava.io.IOException
- if an I/O error occurs.RemoteException
- if a RMI failure occursvoid writeDouble(double v) throws java.io.IOException, RemoteException
RandomAccessFile.writeDouble(double)
.v
- the integer to writejava.io.IOException
- if an I/O error occurs.RemoteException
- if a RMI failure occursvoid writeBytes(java.lang.String s) throws java.io.IOException, RemoteException
RandomAccessFile.writeBytes(String)
.s
- the string to writejava.io.IOException
- if an I/O error occurs.RemoteException
- if a RMI failure occursvoid writeChars(java.lang.String s) throws java.io.IOException, RemoteException
RandomAccessFile.writeChars(String)
.s
- the string to writejava.io.IOException
- if an I/O error occurs.RemoteException
- if a RMI failure occursvoid writeUTF(java.lang.String s) throws java.io.IOException, RemoteException
RandomAccessFile.writeUTF(String)
.s
- the string to writejava.io.IOException
- if an I/O error occurs.RemoteException
- if a RMI failure occursvoid seek(long pos) throws java.io.IOException, RemoteException
RandomAccessFile.seek(long)
.pos
- the offset position, measured in bytes from thebeginning of the
file, at which to set the filepointer.java.io.IOException
- if an I/O error occurs.RemoteException
- if a RMI failure occurslong length() throws java.io.IOException, RemoteException
RandomAccessFile.length()
.java.io.IOException
- if an I/O error occurs.RemoteException
- if a RMI failure occursvoid setLength(long newLength) throws java.io.IOException, RemoteException
RandomAccessFile.setLength(long)
.newLength
- The desired length of the filejava.io.IOException
- if an I/O error occurs.RemoteException
- if a RMI failure occursvoid close() throws java.io.IOException
close
in interface java.lang.AutoCloseable
close
in interface java.io.Closeable
java.io.IOException