public class KLVObject extends Object
Implementation of a KLV triple value.
| Modifier and Type | Class and Description |
|---|---|
static class |
KLVObject.KeyFormat |
static class |
KLVObject.LengthFormat |
| Constructor and Description |
|---|
KLVObject()
Construct a KLV object where nothing is yet known about it.
|
KLVObject(UL theUL)
Construct a KLV object with the given key.
|
| Modifier and Type | Method and Description |
|---|---|
String |
describeSource()
Get a textual description of where this KLV object came from.
|
String |
describeSourceLocation()
Get a textual description of exactly where this item came from, including its location.
|
ByteBuffer |
getData() |
long |
getDataBaseOffset() |
GenericContainerElementKind |
getGCElementKind() |
int |
getGCTrackNumber() |
int |
getKLSize()
Get the size of the key and length of this KLV object.
|
long |
getLength() |
long |
getLocation()
Get the location of this KLV object within its ultimate parent.
|
UL |
getUL()
Get this KLV objects universal label or key.
|
int |
readData(int size) |
int |
readDataFrom(long offset) |
int |
readDataFrom(long offset,
int size) |
int |
readKL() |
void |
setDataBaseOffset(long dataBaseOffset) |
void |
setDestination(MXFFileImpl file)
Set the destination details for this object when written to a file, using the current file
location.
|
void |
setDestination(MXFFileImpl file,
long location)
Set the destination details for this object when written to a file, with the option to
provide the file location.
|
void |
setKLSize(int klSize)
Set the size of the key and length of this KLV object.
|
void |
setLength(long length) |
void |
setSource(MXFFileImpl file)
Set the source details when an object has been read from a file using the current position.
|
void |
setSource(MXFFileImpl file,
long location)
Set the source details when an object has been read from a file, with the option to provide
a byte offset.
|
void |
setUL(UL newUL)
Set this KLV objects universal label or key.
|
int |
writeData() |
int |
writeData(int size) |
int |
writeDataFrom(long start) |
int |
writeDataFrom(long start,
int size) |
int |
writeDataFromTo(long offset,
long start) |
int |
writeDataFromTo(long offset,
long start,
int size) |
int |
writeDataTo(byte[] buffer,
long start,
long offset,
int size) |
int |
writeDataTo(long offset) |
int |
writeDataTo(long offset,
int size) |
int |
writeKL() |
int |
writeKL(int lengthSize) |
public KLVObject()
Construct a KLV object where nothing is yet known about it.
public KLVObject(UL theUL)
Construct a KLV object with the given key.
theUL - Key for the new KLV object.public void setSource(MXFFileImpl file, @Int64 long location) throws NullPointerException
Set the source details when an object has been read from a file, with the option to provide a byte offset.
file - The source file of this KLV object.location - The byte offset of the start of the key of the KLV from the start of the file, or
current position if -1.NullPointerException - Cannot set the source of this KLV object to be a null value.public void setSource(MXFFileImpl file) throws NullPointerException
Set the source details when an object has been read from a file using the current position.
file - The source file of this KLV object.NullPointerException - Cannot set the source of this KLV object to be a null value.public void setDestination(MXFFileImpl file, @Int64 long location) throws NullPointerException
Set the destination details for this object when written to a file, with the option to provide the file location.
file - The destination file for the KLV object.location - The byte offset of the start of the key of the KLV from the start of the file,
or if -1 then the current position in that file will be used.NullPointerException - Cannot set the destination for this KLV object to be a null value.public void setDestination(MXFFileImpl file) throws NullPointerException
Set the destination details for this object when written to a file, using the current file location.
file - The destination file for the KLV object.location - The byte offset of the start of the key of the KLV from the start of the file,
or if -1 then the current position in that file will be used.NullPointerException - Cannot set the destination for this KLV object to be a
null value.public UL getUL()
Get this KLV objects universal label or key. Note that this could be null
if not yet set.
public void setUL(UL newUL)
Set this KLV objects universal label or key.
newUL - New universal label for this KLV object, which can be null.@Int64 public long getLocation()
Get the location of this KLV object within its ultimate parent.
public String describeSource()
Get a textual description of where this KLV object came from.
public String describeSourceLocation()
Get a textual description of exactly where this item came from, including its location.
@Int32 public int getKLSize()
Get the size of the key and length of this KLV object. This does not include the size of the value.
public void setKLSize(@Int32 int klSize)
Set the size of the key and length of this KLV object. This does not include the size of the value. Note that you cannot change the source size.
klSize - Size to set for the key and length.public GenericContainerElementKind getGCElementKind()
@UInt32 public int getGCTrackNumber()
@Int64 public long getDataBaseOffset()
public void setDataBaseOffset(@Int64 long dataBaseOffset)
@Int32 public int readKL()
public int readDataFrom(@MXFPosition long offset, int size)
public int readDataFrom(@MXFPosition long offset)
@Int32 public int writeKL()
public int writeData(int size)
public int writeData()
public int writeDataFrom(@MXFPosition long start, int size)
public int writeDataFrom(@MXFPosition long start)
public int writeDataTo(@MXFPosition long offset, int size)
public int writeDataTo(@MXFPosition long offset)
public int writeDataFromTo(@MXFPosition long offset, @MXFPosition long start, int size)
public int writeDataFromTo(@MXFPosition long offset, @MXFPosition long start)
public int writeDataTo(@UInt8Array byte[] buffer, @MXFPosition long start, @MXFPosition long offset, int size)
@MXFLength public long getLength()
public void setLength(@MXFLength long length)
public ByteBuffer getData()
(c)2007-2016 Richard Cartwright, all rights reserved. Licensed under Apache 2 license and subject to the AMWA IPR policy.