Media Authoring
with Java API

tv.amwa.maj.iface
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.

Author:
Richard Cartwright

Method Summary
 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.

Media Authoring
with Java API

(c) 2007-2008 Richard Cartwright, all rights reserved. Subject to the terms of the AAF SDK Public Source License.