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

tv.amwa.maj.model

## Interface GetFileBits

-     public interface GetFileBits

  Specifies a mechanism to obtain the raw bits of a file after close.

  Note that this and the `SetFileBits` interfaces are different than the `RawStorage` 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
    --- | ---
    `long` | `getSize()` Returns the size of the file in bytes.
    `byte[]` | `readAt(int bufSize, long position)` Attempts to read bufsize bytes from this stream at the given byte offset and returns them as a byte array.

- - ### Method Detail

    - #### readAt

          @DataBuffer
          byte[] readAt(@UInt32
                                    int bufSize,
                                    @UInt64
                                    long position)
                             throws OffsetSizeException

      Attempts to read bufsize bytes from this stream at the given byte offset and returns them as a byte array. Any attempt to read beyond the size of this file, as reported by `getSize()`, will be considered an error.

      A value of zero for position indicates the beginning of the stream.

      Parameters:
        `bufSize` - Size of the buffer to read into.
        `position` - The position into the file from which to read.
      Returns:
        Buffer containing bytes read from the file.
      Throws:
        `OffsetSizeException` - The sum `position + bufSize` is larger than the size of the file.

    - #### getSize

          @UInt64
          long getSize()

      Returns the size of the file in bytes.

      Returns:
        The size of this file in bytes.

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