@MediaClass(uuid1=218169857, uuid2=273, uuid3=256, uuid4={6,14,43,52,2,5,1,1}, definedName="RandomIndexPack", description="A device to help find partitions scattered throughout an MXF file.", namespace="http://www.smpte-ra.org/rp210", prefix="mxf", symbol="RandomIndexPack") public class RandomIndexPackImpl extends Object implements MetadataObject, Serializable, Cloneable, RandomIndexPack
Random index pack data for an MXF file.
PartitionImpl,
PartitionInformation,
Serialized FormripKeyValue| Constructor and Description |
|---|
RandomIndexPackImpl() |
| Modifier and Type | Method and Description |
|---|---|
void |
addRandomIndexItem(int bodySID,
long byteOffset)
Add a random index item to this pack by its body stream identifier and byte offset.
|
void |
addRandomIndexItem(RandomIndexItem randomPartitionItem)
Add an existing random index item to this pack.
|
void |
clear()
Clears the partition table within this random index pack.
|
RandomIndexPack |
clone()
Creates a cloned copy of this random index pack.
|
int |
count()
Returns the number of partitions indexed by this random index pack.
|
static RandomIndexPack |
createFromBytes(ByteBuffer ripBytes) |
boolean |
equals(Object o) |
int |
getLength()
Returns the overall length of the random index pack when encoded as
bytes, including the key and BER length.
|
RandomIndexItem[] |
getPartitionIndex()
Returns the array random index items of this random index pack.
|
UnitType |
getUnitType() |
int |
hashCode() |
static int |
initializeLength() |
static RandomIndexItem[] |
initializePartitionIndex() |
long[] |
lookupPartitionOffsets(int bodySID)
Returns an ordered list of the byte offsets for partitions containing
the given body stream identifier.
|
void |
setLength(int length) |
void |
setPartitionIndex(RandomIndexItem[] partitionIndex)
Sets the array of random index items of this random index pack.
|
String |
toString() |
int |
writeAsBytes(ByteBuffer buffer)
Serializes this random index pack into its file-based KLV-encoded version in
the given buffer.
|
@MediaProperty(uuid1=251658240, uuid2=0, uuid3=115, uuid4={6,14,43,52,0,0,0,0}, definedName="PartitionIndex", typeName="RandomIndexItemArray", optional=false, uniqueIdentifier=false, symbol="PartitionIndex") public RandomIndexItem[] getPartitionIndex()
RandomIndexPackReturns the array random index items of this random index pack. Each partition of the MXF file indexed should have an entry in this array. The array is ordered by the byte offset of the partition.
getPartitionIndex in interface RandomIndexPackPartitionPack.getThisPartition(),
TypeDefinitions.RandomIndexItem,
TypeDefinitions.RandomIndexItemArray@MediaPropertySetter(value="PartitionIndex") public void setPartitionIndex(RandomIndexItem[] partitionIndex) throws NullPointerException
RandomIndexPackSets the array of random index items of this random index pack. Each partition of the MXF file indexed should have an entry in this array. The items will be sorted into byte offset order.
setPartitionIndex in interface RandomIndexPackpartitionIndex - Array of random index items of this random index pack.NullPointerException - Cannot set the partition index with a null
array.@UInt64Array public long[] lookupPartitionOffsets(@UInt32 int bodySID)
RandomIndexPackReturns an ordered list of the byte offsets for partitions containing the given body stream identifier. The order of the partitions is the play order of the essence contained in the essence streams.
lookupPartitionOffsets in interface RandomIndexPackbodySID - Body stream identifier to query the partition offsets for.@MediaPropertyCount(value="PartitionIndex") public int count()
RandomIndexPackReturns the number of partitions indexed by this random index pack.
count in interface RandomIndexPack@MediaPropertyClear(value="PartitionIndex") public void clear()
RandomIndexPackClears the partition table within this random index pack.
clear in interface RandomIndexPackpublic void addRandomIndexItem(@UInt32 int bodySID, @UInt64 long byteOffset) throws IllegalArgumentException
RandomIndexPackAdd a random index item to this pack by its body stream identifier and byte offset. A random index item describes the location of a partition and which body stream it contains data for.
addRandomIndexItem in interface RandomIndexPackbodySID - Body stream identifier of the partition.byteOffset - Byte offset of the partition in the file, measured from
the beginning of the header partition.IllegalArgumentException - Cannot set the body stream identifier or
the byte offset to a negative value.RandomIndexPack.addRandomIndexItem(RandomIndexItem),
PartitionPack.getThisPartition(),
PartitionPack.getBodySID()public void addRandomIndexItem(RandomIndexItem randomPartitionItem) throws NullPointerException
RandomIndexPackAdd an existing random index item to this pack. A random index item describes the location of a partition and which body stream it contains data for.
addRandomIndexItem in interface RandomIndexPackrandomPartitionItem - Item to add to this pack.NullPointerException - Cannot add a null index item.RandomIndexPack.addRandomIndexItem(int, long)@MediaProperty(uuid1=67506177, uuid2=0, uuid3=0, uuid4={6,14,43,52,1,1,1,4}, definedName="Length", typeName="UInt32", uniqueIdentifier=false, optional=false, symbol="Length") @UInt32 public int getLength()
RandomIndexPackReturns the overall length of the random index pack when encoded as bytes, including the key and BER length.
getLength in interface RandomIndexPackRandomIndexPack.writeAsBytes(ByteBuffer)@MediaPropertySetter(value="Length") public void setLength(@UInt32 int length) throws IllegalArgumentException
IllegalArgumentExceptionpublic RandomIndexPack clone()
RandomIndexPackCreates a cloned copy of this random index pack.
clone in interface RandomIndexPackclone in class Objectpublic int writeAsBytes(ByteBuffer buffer) throws NullPointerException, InsufficientSpaceException
RandomIndexPackSerializes this random index pack into its file-based KLV-encoded version in
the given buffer. The buffer must have at least RandomIndexPack.getLength() bytes remaining.
writeAsBytes in interface RandomIndexPackbuffer - Buffer to write this random index pack into.NullPointerException - Cannot write this random index pack to a null buffer.InsufficientSpaceException - The given buffer does not have sufficient space
remaining.RandomIndexPack.getLength()public UnitType getUnitType()
getUnitType in interface MXFUnitpublic static RandomIndexPack createFromBytes(ByteBuffer ripBytes) throws BufferUnderflowException
BufferUnderflowExceptionpublic static final int initializeLength()
public static final RandomIndexItem[] initializePartitionIndex()
(c)2007-2016 Richard Cartwright, all rights reserved. Licensed under Apache 2 license and subject to the AMWA IPR policy.