Package com.microej.kf.util.control.fs
Class SetLengthRandomAccessFile
- java.lang.Object
-
- com.microej.kf.util.control.fs.SetLengthRandomAccessFile
-
public class SetLengthRandomAccessFile extends java.lang.ObjectAction performed when setting the length of a RandomAccessFile.
-
-
Constructor Summary
Constructors Constructor Description SetLengthRandomAccessFile(java.io.RandomAccessFile file, long newLength)Creates a write file action.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description longgetNbBytes()Gets the number of bytes to write.voidonEnd(boolean endWithSuccess)Called when the execution of the action is finished.voidonStart()Called when the execution of the action is about to start.
-
-
-
Constructor Detail
-
SetLengthRandomAccessFile
public SetLengthRandomAccessFile(java.io.RandomAccessFile file, long newLength) throws java.io.IOExceptionCreates a write file action.- Parameters:
file- the file to write.newLength- the new length to set.- Throws:
java.io.IOException- if an error occurs while accessing the file.
-
-
Method Detail
-
getNbBytes
public long getNbBytes()
Gets the number of bytes to write.- Returns:
- the number of bytes to write.
-
onStart
public void onStart() throws java.lang.SecurityExceptionCalled when the execution of the action is about to start. This hook is used to check if the action is allowed to be performed.- Throws:
java.lang.SecurityException- if the action is not allowed to be performed.
-
onEnd
public void onEnd(boolean endWithSuccess)
Called when the execution of the action is finished. This hook is used to update the current resources state of the module that performs the action.- Parameters:
endWithSuccess- true if the execution of the action was ended with success; false otherwise.
-
-