Class WriteRandomAccessFile


  • public class WriteRandomAccessFile
    extends Object
    Action performed when writing to a RandomAccessFile.
    • Constructor Detail

      • WriteRandomAccessFile

        public WriteRandomAccessFile​(RandomAccessFile file,
                                     int nbWriteBytes)
                              throws IOException
        Creates a write file action.
        Parameters:
        file - the file to write.
        nbWriteBytes - the number of bytes to write.
        Throws:
        IOException - if I/O errors occur.
    • 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 SecurityException
        Called 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:
        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.