public class SetLengthRandomAccessFile extends Object
Constructor and Description |
---|
SetLengthRandomAccessFile(RandomAccessFile file,
long newLength)
Creates a write file action.
|
Modifier and Type | Method and Description |
---|---|
long |
getNbBytes()
Gets the number of bytes to write.
|
void |
onEnd(boolean endWithSuccess)
Called when the execution of the action is finished.
|
void |
onStart()
Called when the execution of the action is about to start.
|
public SetLengthRandomAccessFile(RandomAccessFile file, long newLength) throws IOException
file
- the file to write.newLength
- the new length to set.IOException
- if an error occurs while accessing the file.public long getNbBytes()
public void onEnd(boolean endWithSuccess)
endWithSuccess
- true if the execution of the action was ended with success; false otherwise.public void onStart() throws SecurityException
SecurityException
- if the action is not allowed to be performed.