public abstract class PartitionImpl extends Object implements Partition, Cloneable
Data relating to a single MXF partition.
SIZE_UNKNOWN| Constructor and Description |
|---|
PartitionImpl() |
| Modifier and Type | Method and Description |
|---|---|
Partition |
clone()
Create a cloned copy of this partition.
|
long |
getActualSize()
Returns the current size allocated for the partition, including any fill.
|
long |
getInitialSize()
Returns the initial partition size given for this partition that is used to calculate
the minimum allowed size for the partition.
|
abstract PartitionPack |
getPartitionPack()
Returns the partition pack that describes this partition, including its size and what it
contains.
|
boolean |
hasEssenceContainer()
Determines whether this partition has an essence container, indicating the
presence of (part of) a body stream.
|
boolean |
hasHeaderMetadata()
Determines whether this partition contains header metadata.
|
boolean |
hasIndexTable()
Determines whether this partition contains index table data.
|
static Partition |
partitionFactory(MXFFileImpl mxfFile) |
HeaderMetadata |
readHeaderMetadata()
Returns the header metadata contained within the partition, if any.
|
IndexTableSegment |
readIndexTableSegment()
Reads the index table segment of this partition, if any is
present.
|
void |
setActualSize(long actualSize) |
void |
setInitialDataSize(long initialSize)
Sets the initial partition size for this partition that is used to calculate the
minimum allowed size for the partition.
|
abstract void |
setPartitionPackPadding(long paddingFillSize)
Set the amount of padding to include after each significant entry in the partition,
allowing space for the metadata to expand over time.
|
String |
toString() |
void |
updateSizes()
Update the size of partition based on the best information known at this time.
|
void |
writeHeaderMetadata(Preface preface,
long headerByteCount)
Write the header metadata of this partition using that provided
in the given preface.
|
void |
writeIndexTableSegment(IndexTableSegment indexTableSegment,
long segmentLength) |
void |
writePartitionPack() |
void |
writeSingleIndexSegment(IndexTableSegment indexTableSegment) |
public abstract PartitionPack getPartitionPack()
PartitionReturns the partition pack that describes this partition, including its size and what it contains.
getPartitionPack in interface PartitionHeaderPartition.getPartitionPack(),
FooterPartition.getPartitionPack(),
BodyPartition.getPartitionPack()public abstract void setPartitionPackPadding(long paddingFillSize)
throws IllegalArgumentException
PartitionSet the amount of padding to include after each significant entry in the partition, allowing space for the metadata to expand over time.
setPartitionPackPadding in interface PartitionpaddingFillSize - Size of padding to include after the partition.IllegalArgumentException - Cannot set the padding size to a negative value.Padded.getPaddingFillSize(),
Padded.setPaddingFillSize(long)public boolean hasHeaderMetadata()
PartitionDetermines whether this partition contains header metadata. All header partitions must contain header metadata. Other partitions may contain header metadata.
hasHeaderMetadata in interface PartitionPartition.readHeaderMetadata(),
Partition.writeHeaderMetadata(Preface, long)public boolean hasIndexTable()
PartitionDetermines whether this partition contains index table data. The partition may contain a complete index table or just a segment of an index table stream.
hasIndexTable in interface PartitionPartition.readIndexTableSegment()public boolean hasEssenceContainer()
PartitionDetermines whether this partition has an essence container, indicating the presence of (part of) a body stream.
hasEssenceContainer in interface Partitionpublic Partition clone()
PartitionCreate a cloned copy of this partition.
public HeaderMetadata readHeaderMetadata() throws NullPointerException
PartitionReturns the header metadata contained within the partition, if any.
readHeaderMetadata in interface Partitionnull if no header
metadata is present.NullPointerException - The partition's MXF file is null which may
occur if this partition is being created unattached.Partition.hasHeaderMetadata(),
Partition.writeHeaderMetadata(Preface, long)public void writeHeaderMetadata(Preface preface, long headerByteCount) throws NullPointerException, InsufficientSpaceException, IOException
PartitionWrite the header metadata of this partition using that provided in the given preface. Previous header metadata will be overwritten. Note that sufficient space must be available.
writeHeaderMetadata in interface PartitionheaderByteCount - Number of bytes the encoded header should fit within, including filler.NullPointerException - Cannot associate null header metadata with this partition.InsufficientSpaceException - Calculations based on partition sizes shows that insufficient space
is available to write this header metadata.IOException - Problem occurred writing to the filesystem.Partition.readHeaderMetadata(),
Partition.hasHeaderMetadata(),
#calculateMinimumHeaderMetadataSize(Preface)public void writeIndexTableSegment(IndexTableSegment indexTableSegment, long segmentLength) throws NullPointerException, InsufficientSpaceException, IOException
writeIndexTableSegment in interface PartitionNullPointerExceptionInsufficientSpaceExceptionIOExceptionpublic void writeSingleIndexSegment(IndexTableSegment indexTableSegment) throws NullPointerException, InsufficientSpaceException, IOException
writeSingleIndexSegment in interface PartitionNullPointerExceptionInsufficientSpaceExceptionIOExceptionpublic void writePartitionPack()
throws NullPointerException,
InsufficientSpaceException,
IOException
public IndexTableSegment readIndexTableSegment() throws NullPointerException
PartitionReads the index table segment of this partition, if any is present.
readIndexTableSegment in interface Partitionnull if no index data is
present.NullPointerException - The partition's MXF file is null which may
occur if this partition is being created unattached.Partition.hasIndexTable()public long getInitialSize()
PartitionReturns the initial partition size given for this partition that is used to calculate the minimum allowed size for the partition. Note that this value does not necessarily reflect the actual size of the partition.
getInitialSize in interface PartitionPartition.SIZE_UNKNOWN,
Partition.getActualSize()public void setInitialDataSize(long initialSize)
PartitionSets the initial partition size for this partition that is used to calculate the
minimum allowed size for the partition. Use a value of Partition.SIZE_UNKNOWN to get MAJ to
calculate the size. Note that the implementation will expand the size
of the partition beyond the minimum given with this method if required. The size is
specified excluding the size of the partition pack.
setInitialDataSize in interface PartitioninitialSize - Initial partition size.Partition.SIZE_UNKNOWN,
Partition.getActualSize()public long getActualSize()
PartitionReturns the current size allocated for the partition, including any fill. This size may be updated during writing.
getActualSize in interface PartitionPartition.getInitialSize()public void setActualSize(long actualSize)
public void updateSizes()
PartitionUpdate the size of partition based on the best information known at this time.
updateSizes in interface PartitionMXFFile.updatePackSizes()public static final Partition partitionFactory(MXFFileImpl mxfFile) throws EndOfDataException
EndOfDataException(c)2007-2016 Richard Cartwright, all rights reserved. Licensed under Apache 2 license and subject to the AMWA IPR policy.