Package org.apache.activemq.util
Class RecoverableRandomAccessFile
- java.lang.Object
-
- org.apache.activemq.util.RecoverableRandomAccessFile
-
- All Implemented Interfaces:
Closeable
,DataInput
,DataOutput
,AutoCloseable
public class RecoverableRandomAccessFile extends Object implements DataOutput, DataInput, Closeable
-
-
Constructor Summary
Constructors Constructor Description RecoverableRandomAccessFile(File file, String mode)
RecoverableRandomAccessFile(File file, String mode, boolean skipMetadataUpdate)
RecoverableRandomAccessFile(String name, String mode)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
FileChannel
getChannel()
FileDescriptor
getFD()
RandomAccessFile
getRaf()
protected void
handleException()
long
length()
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[] bytes)
void
readFully(byte[] bytes, int i, int i2)
int
readInt()
String
readLine()
long
readLong()
short
readShort()
int
readUnsignedByte()
int
readUnsignedShort()
String
readUTF()
void
seek(long pos)
void
setLength(long length)
int
skipBytes(int i)
void
sync()
void
write(byte[] bytes)
void
write(byte[] bytes, int i, int i2)
void
write(int i)
void
writeBoolean(boolean b)
void
writeByte(int i)
void
writeBytes(String s)
void
writeChar(int i)
void
writeChars(String s)
void
writeDouble(double v)
void
writeFloat(float v)
void
writeInt(int i)
void
writeLong(long l)
void
writeShort(int i)
void
writeUTF(String s)
-
-
-
Constructor Detail
-
RecoverableRandomAccessFile
public RecoverableRandomAccessFile(File file, String mode, boolean skipMetadataUpdate) throws FileNotFoundException
- Throws:
FileNotFoundException
-
RecoverableRandomAccessFile
public RecoverableRandomAccessFile(File file, String mode) throws FileNotFoundException
- Throws:
FileNotFoundException
-
RecoverableRandomAccessFile
public RecoverableRandomAccessFile(String name, String mode) throws FileNotFoundException
- Throws:
FileNotFoundException
-
-
Method Detail
-
getRaf
public RandomAccessFile getRaf() throws IOException
- Throws:
IOException
-
handleException
protected void handleException() throws IOException
- Throws:
IOException
-
close
public void close() throws IOException
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Throws:
IOException
-
readFully
public void readFully(byte[] bytes) throws IOException
- Specified by:
readFully
in interfaceDataInput
- Throws:
IOException
-
readFully
public void readFully(byte[] bytes, int i, int i2) throws IOException
- Specified by:
readFully
in interfaceDataInput
- Throws:
IOException
-
skipBytes
public int skipBytes(int i) throws IOException
- Specified by:
skipBytes
in interfaceDataInput
- Throws:
IOException
-
readBoolean
public boolean readBoolean() throws IOException
- Specified by:
readBoolean
in interfaceDataInput
- Throws:
IOException
-
readByte
public byte readByte() throws IOException
- Specified by:
readByte
in interfaceDataInput
- Throws:
IOException
-
readUnsignedByte
public int readUnsignedByte() throws IOException
- Specified by:
readUnsignedByte
in interfaceDataInput
- Throws:
IOException
-
readShort
public short readShort() throws IOException
- Specified by:
readShort
in interfaceDataInput
- Throws:
IOException
-
readUnsignedShort
public int readUnsignedShort() throws IOException
- Specified by:
readUnsignedShort
in interfaceDataInput
- Throws:
IOException
-
readChar
public char readChar() throws IOException
- Specified by:
readChar
in interfaceDataInput
- Throws:
IOException
-
readInt
public int readInt() throws IOException
- Specified by:
readInt
in interfaceDataInput
- Throws:
IOException
-
readLong
public long readLong() throws IOException
- Specified by:
readLong
in interfaceDataInput
- Throws:
IOException
-
readFloat
public float readFloat() throws IOException
- Specified by:
readFloat
in interfaceDataInput
- Throws:
IOException
-
readDouble
public double readDouble() throws IOException
- Specified by:
readDouble
in interfaceDataInput
- Throws:
IOException
-
readLine
public String readLine() throws IOException
- Specified by:
readLine
in interfaceDataInput
- Throws:
IOException
-
readUTF
public String readUTF() throws IOException
- Specified by:
readUTF
in interfaceDataInput
- Throws:
IOException
-
write
public void write(int i) throws IOException
- Specified by:
write
in interfaceDataOutput
- Throws:
IOException
-
write
public void write(byte[] bytes) throws IOException
- Specified by:
write
in interfaceDataOutput
- Throws:
IOException
-
write
public void write(byte[] bytes, int i, int i2) throws IOException
- Specified by:
write
in interfaceDataOutput
- Throws:
IOException
-
writeBoolean
public void writeBoolean(boolean b) throws IOException
- Specified by:
writeBoolean
in interfaceDataOutput
- Throws:
IOException
-
writeByte
public void writeByte(int i) throws IOException
- Specified by:
writeByte
in interfaceDataOutput
- Throws:
IOException
-
writeShort
public void writeShort(int i) throws IOException
- Specified by:
writeShort
in interfaceDataOutput
- Throws:
IOException
-
writeChar
public void writeChar(int i) throws IOException
- Specified by:
writeChar
in interfaceDataOutput
- Throws:
IOException
-
writeInt
public void writeInt(int i) throws IOException
- Specified by:
writeInt
in interfaceDataOutput
- Throws:
IOException
-
writeLong
public void writeLong(long l) throws IOException
- Specified by:
writeLong
in interfaceDataOutput
- Throws:
IOException
-
writeFloat
public void writeFloat(float v) throws IOException
- Specified by:
writeFloat
in interfaceDataOutput
- Throws:
IOException
-
writeDouble
public void writeDouble(double v) throws IOException
- Specified by:
writeDouble
in interfaceDataOutput
- Throws:
IOException
-
writeBytes
public void writeBytes(String s) throws IOException
- Specified by:
writeBytes
in interfaceDataOutput
- Throws:
IOException
-
writeChars
public void writeChars(String s) throws IOException
- Specified by:
writeChars
in interfaceDataOutput
- Throws:
IOException
-
writeUTF
public void writeUTF(String s) throws IOException
- Specified by:
writeUTF
in interfaceDataOutput
- Throws:
IOException
-
length
public long length() throws IOException
- Throws:
IOException
-
setLength
public void setLength(long length) throws IOException
- Throws:
IOException
-
seek
public void seek(long pos) throws IOException
- Throws:
IOException
-
getFD
public FileDescriptor getFD() throws IOException
- Throws:
IOException
-
sync
public void sync() throws IOException
- Throws:
IOException
-
getChannel
public FileChannel getChannel() throws IOException
- Throws:
IOException
-
read
public int read(byte[] b, int off, int len) throws IOException
- Throws:
IOException
-
read
public int read(byte[] b) throws IOException
- Throws:
IOException
-
-