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 voidclose()FileChannelgetChannel()FileDescriptorgetFD()RandomAccessFilegetRaf()protected voidhandleException()longlength()intread(byte[] b)intread(byte[] b, int off, int len)booleanreadBoolean()bytereadByte()charreadChar()doublereadDouble()floatreadFloat()voidreadFully(byte[] bytes)voidreadFully(byte[] bytes, int i, int i2)intreadInt()StringreadLine()longreadLong()shortreadShort()intreadUnsignedByte()intreadUnsignedShort()StringreadUTF()voidseek(long pos)voidsetLength(long length)intskipBytes(int i)voidsync()voidwrite(byte[] bytes)voidwrite(byte[] bytes, int i, int i2)voidwrite(int i)voidwriteBoolean(boolean b)voidwriteByte(int i)voidwriteBytes(String s)voidwriteChar(int i)voidwriteChars(String s)voidwriteDouble(double v)voidwriteFloat(float v)voidwriteInt(int i)voidwriteLong(long l)voidwriteShort(int i)voidwriteUTF(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:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
IOException
-
readFully
public void readFully(byte[] bytes) throws IOException- Specified by:
readFullyin interfaceDataInput- Throws:
IOException
-
readFully
public void readFully(byte[] bytes, int i, int i2) throws IOException- Specified by:
readFullyin interfaceDataInput- Throws:
IOException
-
skipBytes
public int skipBytes(int i) throws IOException- Specified by:
skipBytesin interfaceDataInput- Throws:
IOException
-
readBoolean
public boolean readBoolean() throws IOException- Specified by:
readBooleanin interfaceDataInput- Throws:
IOException
-
readByte
public byte readByte() throws IOException- Specified by:
readBytein interfaceDataInput- Throws:
IOException
-
readUnsignedByte
public int readUnsignedByte() throws IOException- Specified by:
readUnsignedBytein interfaceDataInput- Throws:
IOException
-
readShort
public short readShort() throws IOException- Specified by:
readShortin interfaceDataInput- Throws:
IOException
-
readUnsignedShort
public int readUnsignedShort() throws IOException- Specified by:
readUnsignedShortin interfaceDataInput- Throws:
IOException
-
readChar
public char readChar() throws IOException- Specified by:
readCharin interfaceDataInput- Throws:
IOException
-
readInt
public int readInt() throws IOException- Specified by:
readIntin interfaceDataInput- Throws:
IOException
-
readLong
public long readLong() throws IOException- Specified by:
readLongin interfaceDataInput- Throws:
IOException
-
readFloat
public float readFloat() throws IOException- Specified by:
readFloatin interfaceDataInput- Throws:
IOException
-
readDouble
public double readDouble() throws IOException- Specified by:
readDoublein interfaceDataInput- Throws:
IOException
-
readLine
public String readLine() throws IOException
- Specified by:
readLinein interfaceDataInput- Throws:
IOException
-
readUTF
public String readUTF() throws IOException
- Specified by:
readUTFin interfaceDataInput- Throws:
IOException
-
write
public void write(int i) throws IOException- Specified by:
writein interfaceDataOutput- Throws:
IOException
-
write
public void write(byte[] bytes) throws IOException- Specified by:
writein interfaceDataOutput- Throws:
IOException
-
write
public void write(byte[] bytes, int i, int i2) throws IOException- Specified by:
writein interfaceDataOutput- Throws:
IOException
-
writeBoolean
public void writeBoolean(boolean b) throws IOException- Specified by:
writeBooleanin interfaceDataOutput- Throws:
IOException
-
writeByte
public void writeByte(int i) throws IOException- Specified by:
writeBytein interfaceDataOutput- Throws:
IOException
-
writeShort
public void writeShort(int i) throws IOException- Specified by:
writeShortin interfaceDataOutput- Throws:
IOException
-
writeChar
public void writeChar(int i) throws IOException- Specified by:
writeCharin interfaceDataOutput- Throws:
IOException
-
writeInt
public void writeInt(int i) throws IOException- Specified by:
writeIntin interfaceDataOutput- Throws:
IOException
-
writeLong
public void writeLong(long l) throws IOException- Specified by:
writeLongin interfaceDataOutput- Throws:
IOException
-
writeFloat
public void writeFloat(float v) throws IOException- Specified by:
writeFloatin interfaceDataOutput- Throws:
IOException
-
writeDouble
public void writeDouble(double v) throws IOException- Specified by:
writeDoublein interfaceDataOutput- Throws:
IOException
-
writeBytes
public void writeBytes(String s) throws IOException
- Specified by:
writeBytesin interfaceDataOutput- Throws:
IOException
-
writeChars
public void writeChars(String s) throws IOException
- Specified by:
writeCharsin interfaceDataOutput- Throws:
IOException
-
writeUTF
public void writeUTF(String s) throws IOException
- Specified by:
writeUTFin 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
-
-