|
Media Authoring with Java API |
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objecttv.amwa.maj.entity.InterchangeObject
tv.amwa.maj.entity.RIFFChunk
@AAFClass(uuid1=218169601,
uuid2=257,
uuid3=20224,
uuid4={6,14,43,52,2,6,1,1},
definedName="RIFFChunk",
description="Chunk of data as defined by the Resource Interchange File Format (RIFF).")
public class RIFFChunk
Implements the representation of a chunk of resource interchange file format (RIFF) data, identified by a 4-byte tag and variable size field.
THE COMMENTS FOR THIS CLASS ARE INCOMPLETE.
| Nested Class Summary | |
|---|---|
static class |
RIFFChunk.XMLHandler
|
| Nested classes/interfaces inherited from class tv.amwa.maj.entity.InterchangeObject |
|---|
InterchangeObject.InterchangeObjectXMLHandler |
| Field Summary | |
|---|---|
static String |
RIFFCHUNK_TAG
|
| Constructor Summary | |
|---|---|
RIFFChunk(int chunkID)
Creates and initializes a new RIFF data chunk with the given chunk identifier. |
|
| Method Summary | |
|---|---|
void |
appendXMLChildren(Node parent)
Append child elements to the given parent node to serialize the value of an object to an XML fragment. |
RIFFChunk |
clone()
Creates a cloned copy of this entity. |
boolean |
equals(Object o)
Tests to see if the given object is equal to this interchange object. |
byte[] |
getChunkData()
Returns the complete data of this RIFF chunk. |
int |
getChunkID()
Returns the chunk id of this RIFF chunk, which is a 4-byte tag that identifies this tag. |
long |
getLength()
Returns the total size of this RIFF chunk measured in bytes. |
long |
getPosition()
Returns the current position for reading or writing the RIFF chunk data. |
int |
hashCode()
Returns a hash code value for this interchange object. |
byte[] |
read(int numberOfBytes)
Read the requested number of bytes from the RIFF chunk at the current position. |
void |
setChunkData(byte[] chunkData)
Sets the complete data of this RIFF chunk and initializes the position to zero. |
void |
setChunkID(int chunkID)
Sets the chunk id of this RIFF chunk, which is a 4-byte tag that identifies this tag. |
void |
setPosition(long offset)
Sets the position for reading or writing this RIFF chunk data. |
void |
setPropertiesFromInterface(RIFFChunk castFrom)
|
void |
write(byte[] bytes)
Writes the given bytes to this RIFF chunk data at the current position. |
| Methods inherited from class tv.amwa.maj.entity.InterchangeObject |
|---|
castFromInterface, countProperties, createOptionalPropertyValue, disableGenerationTracking, enableGenerationTracking, getDefinition, getGeneration, getGenerationAUID, getProperties, getPropertyValue, isGenerationTracked, isPropertyPresent, omitOpionalProperty, registerImplementation, setPropertiesFromInterface, setPropertyValue, toString |
| Methods inherited from class java.lang.Object |
|---|
getClass, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface tv.amwa.maj.iface.InterchangeObject |
|---|
countProperties, createOptionalPropertyValue, disableGenerationTracking, enableGenerationTracking, getDefinition, getGeneration, getGenerationAUID, getProperties, getPropertyValue, isGenerationTracked, isPropertyPresent, omitOpionalProperty, setPropertyValue |
| Methods inherited from interface tv.amwa.maj.entity.MAJCommon |
|---|
toString |
| Field Detail |
|---|
public static final String RIFFCHUNK_TAG
| Constructor Detail |
|---|
public RIFFChunk(@UInt32
int chunkID)
Creates and initializes a new RIFF data chunk with the given chunk identifier. The identifier is used to represent 4 ASCII characters that represent the kind of data stored inside the chunk.
chunkID - Identifier for the new chunk.| Method Detail |
|---|
public final void setPropertiesFromInterface(RIFFChunk castFrom)
InterchangeObject.setPropertiesFromInterface(tv.amwa.maj.iface.InterchangeObject)
@AAFProperty(uuid1=67568640,
uuid2=0,
uuid3=0,
uuid4={6,14,43,52,1,1,1,8},
definedName="ChunkData",
typeName="Stream",
optional=false,
uniqueIdentifier=false,
pid=20227)
public byte[] getChunkData()
RIFFChunkReturns the complete data of this RIFF chunk.
getChunkData in interface RIFFChunk
public void setChunkData(byte[] chunkData)
throws NullPointerException
RIFFChunkSets the complete data of this RIFF chunk and initializes the position to zero. The length property of this RIFF chunk will be set to the length of the given chunk data.
setChunkData in interface RIFFChunkchunkData - Actual data for this RIFF chunk.
NullPointerException - The chunk data argument is null.
@AAFProperty(uuid1=67504130,
uuid2=0,
uuid3=0,
uuid4={6,14,43,52,1,1,1,8},
definedName="ChunkID",
typeName="UInt32",
optional=false,
uniqueIdentifier=false,
pid=20225)
public int getChunkID()
RIFFChunkReturns the chunk id of this RIFF chunk, which is a 4-byte tag that identifies this tag.
Note that in the representation of this tag, care needs to be taken to ensure that the sign bit is not confused with an 8-bit character code. Negative values are accepted by this method.
getChunkID in interface RIFFChunkpublic void setChunkID(int chunkID)
RIFFChunkSets the chunk id of this RIFF chunk, which is a 4-byte tag that identifies this tag.
Note that in the representation of this tag, care needs to be taken to ensure that the sign bit is not confused with an 8-bit character code. Negative values are accepted by this method.
setChunkID in interface RIFFChunkchunkID - Chunk identifier for this RIFF chunk.
@AAFProperty(uuid1=67504387,
uuid2=0,
uuid3=0,
uuid4={6,14,43,52,1,1,1,8},
definedName="ChunkLength",
typeName="UInt32",
optional=false,
uniqueIdentifier=false,
pid=20226)
public long getLength()
RIFFChunkReturns the total size of this RIFF chunk measured in bytes. The length is
initially 0 until RIFFChunk.setChunkData(byte[]) has been called.
getLength in interface RIFFChunkpublic long getPosition()
RIFFChunkReturns the current position for reading or writing the RIFF chunk data.
getPosition in interface RIFFChunk
public void setPosition(long offset)
throws PositionOutOfRangeException
RIFFChunkSets the position for reading or writing this RIFF chunk data.
setPosition in interface RIFFChunkoffset - Position offset to set for reading or writing RIFF chunk data.
PositionOutOfRangeException - The given offset is outside the acceptable
range for this RIFF chunk data, which is between 0 and the length of the data.RIFFChunk.getLength()
public byte[] read(int numberOfBytes)
throws IllegalArgumentException,
EndOfDataException
RIFFChunkRead the requested number of bytes from the RIFF chunk at the current position. The position is advanced by the number of bytes read.
read in interface RIFFChunknumberOfBytes - Number of bytes to read from the RIFF chunk.
IllegalArgumentException - Cannot read a negative number of bytes.
EndOfDataException - The number of bytes requested are not available in the
RIFF chunk relative to the current position.RIFFChunk.getPosition()
public void write(byte[] bytes)
throws NullPointerException,
EndOfDataException
RIFFChunkWrites the given bytes to this RIFF chunk data at the current position. The position is advanced by the number of bytes written. Any data beyond the new position is lost by truncating the buffer.
write in interface RIFFChunkbytes - Bytes to write to the RIFF chunk data.
NullPointerException - The given array of bytes is null.
EndOfDataException - The size of the RIFF chunk is less than the number of bytes
to write relative to the current position.RIFFChunk.getPosition()public boolean equals(Object o)
MAJCommonTests to see if the given object is equal to this interchange object. To be equal, the given value must be not null, share the same interface to its value and each of the properties of the value must each be equal.
equals in interface MAJCommonequals in class Objecto - Object to test for equality with.
Object.equals(Object)public int hashCode()
MAJCommonReturns a hash code value for this interchange object.
hashCode in interface MAJCommonhashCode in class ObjectObject.hashCode()public RIFFChunk clone()
MAJCommonCreates a cloned copy of this entity. The clone will be initialized to have the same value as this value but exists independently from then on. Changes to this value will not effect the clone and changes to the clone will not effect this. MAJ API clones are true deep clones with no shared references to areas of memory within the original.
This method does not throw a CloneNotSupportedException as all
entity values must implement the Cloneable interface. If a cloning
error does occur, a null value will be returned but this is very unlikely
to happen.
clone in interface MAJCommonclone in class ObjectObject.clone()public void appendXMLChildren(Node parent)
XMLSerializableAppend child elements to the given parent node to serialize the value of an object
to an XML fragment. Methods of the XMLBuilder class are provided to help with this
process.
appendXMLChildren in interface XMLSerializableappendXMLChildren in class InterchangeObjectparent - XML parent element to append child nodes to.
|
Media Authoring with Java API |
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||