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

tv.amwa.maj.model

## Interface SetFileBits

-     public interface SetFileBits

  This interface is implemented by the toolkit, and is provided to clients of `AAF file` to allow them to supply the raw bits of a file before open.

  Note that this and the `get file bits` interfaces are different to the `raw storage` interfaces in that those are implemented by clients to provide access to the desired media; these are provided by the toolkit to provide read OR write (but not both simultaneously) access to the raw bits.

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `setSize(long size)` Attempts to reserve the given number of bytes of storage.
    `void` | `writeAt(byte[] buf, long position)` Writes the given data buffer into the file and the given position.

- - ### Method Detail

    - #### writeAt

          void writeAt(@DataBuffer
                       byte[] buf,
                       @UInt64
                       long position)
                throws NullPointerException,
                       DataSizeException

      Writes the given data buffer into the file and the given position. The position is measured in bytes, with a value of 0 indicating the beginning of the stream.

      Parameters:
        `buf` - Buffer from which data is written.
        `position` - Position in the file at which to write.
      Throws:
        `NullPointerException` - Argument is null.
        `DataSizeException` - The requested space, determined by the position and size of the buffer, is not available.

    - #### setSize

          void setSize(@UInt64
                       long size)
                throws DataSizeException

      Attempts to reserve the given number of bytes of storage.

      Parameters:
        `size` - Number of bytes requested.
      Throws:
        `DataSizeException` - The requested space is not available.

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