RandomFile (Media Authoring with Java API)
Date: 2016-02-05

tv.amwa.maj.model

## Interface RandomFile

- All Superinterfaces:
    AAFFile

      public interface RandomFile
      extends AAFFile

  Specialized file interface for use with files which exist on storage media which has random access capability.

  Objects that implement RandomFile also implement the following interfaces:

  - `AAFFile`
  See Also:
    `GetFileBits`, `SetFileBits`

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `GetFileBits` | `getFileBits()` This method obtains file data after a file has been created.
    `void` | `revert()` Reverts this file to the previously saved state.
    `void` | `saveAsFile(AAFFile destFile)` Associates this file with the storage specified the given destination file.
    `void` | `setFileBits(SetFileBits setFileBits)` File data with which the file is to be created.

    - ### Methods inherited from interface tv.amwa.maj.model.AAFFile

      `close, getDictionary, getPreface, getRevision, open, save, saveCopyAs`

- - ### Method Detail

    - #### getFileBits

          GetFileBits getFileBits()
                           throws BadOpenException,
                                  NotWriteableException,
                                  BadCloseException

      This method obtains file data after a file has been created. The method succeeds if the `file` has been `Opened` and then `closed`, or if it has never previously been opened with write access.

      Returns:
        File data following the creation of a file.
      Throws:
        `BadOpenException` - The file has never been opened.
        `NotWriteableException` - The file has never been opened for writing of modification.
        `BadCloseException` - The file has not been closed having been opened.

    - #### revert

          void revert()

      Reverts this file to the previously saved state.

    - #### saveAsFile

          void saveAsFile(AAFFile destFile)
                   throws NotOpenException,
                          NotWriteableException

      Associates this file with the storage specified the given destination file. Any objects stored in the destination file will be lost.

      This method behaves in a similar way to `AAFFile.saveCopyAs(AAFFile)`, except that this method will change this object to be associated with the new file.

      Special case: if `this.saveAs(this)` is called then the operation will save everything including things which have not changed.

      Parameters:
        `destFile` - File to associated with this one for saving.
      Throws:
        `NotOpenException` - The destination file is not open.
        `NotWriteableException` - The destination file cannot be written.

    - #### setFileBits

          void setFileBits(SetFileBits setFileBits)
                    throws NullPointerException,
                           BadOpenException,
                           NotReadableException

      File data with which the file is to be created. This method only succeeds if the file has not yet been opened.

      Parameters:
        `setFileBits` - File data with which the file is to be created.
      Throws:
        `NullPointerException` - Argument is null.
        `BadOpenException`
        `NotReadableException`

(c)2007-2016 Richard Cartwright, all rights reserved. Licensed under Apache 2 license and subject to the AMWA IPR policy.