public class BackupFile extends RandomAccessFile implements Closeable
Modifier and Type | Field and Description |
---|---|
private boolean |
closed |
private int |
nbRecords |
Constructor and Description |
---|
BackupFile(File file)
Creates a new backup file.
|
Modifier and Type | Method and Description |
---|---|
void |
backup(BackupRecord record)
Backups an object in the file.
|
void |
close()
Closes the backup file.
|
int |
getNbRecords()
Number of objects recorded in the file.
|
getChannel, getFD, getFilePointer, length, read, read, read, readBoolean, readByte, readChar, readDouble, readFloat, readFully, readFully, readInt, readLine, readLong, readShort, readUnsignedByte, readUnsignedShort, readUTF, seek, setLength, skipBytes, write, write, write, writeBoolean, writeByte, writeBytes, writeChar, writeChars, writeDouble, writeFloat, writeInt, writeLong, writeShort, writeUTF
public BackupFile(File file) throws IOException
file
- The file to create.IOException
- An error occurs during creation.public int getNbRecords()
public void backup(BackupRecord record) throws IOException
buf
- the byte array to store.dirName
- the directory name of the object.name
- the name of the object.IOException
- An error occurs.public void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
close
in class RandomAccessFile
IOException
- An error occurs.Copyright © 2023 ScalAgent D.T.. All rights reserved.