|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jaudiotagger.audio.asf.data.ContentDescriptor
public final class ContentDescriptor
This class is a wrapper for properties within a
ExtendedContentDescription.
Each descriptor consists of the folloowing:
Descriptor Name Length 16 bits
Descriptor Name UTF16LE format
Descriptor Value Data Type 16 bits
Descriptor Value Length 16 bits
Descriptor Value varies
| Field Summary | |
|---|---|
static int |
TYPE_BINARY
Constant for the content descriptor-type for binary data. |
static int |
TYPE_BOOLEAN
Constant for the content descriptor-type for booleans. |
static int |
TYPE_DWORD
Constant for the content descriptor-type for integers (32-bit). |
static int |
TYPE_QWORD
Constant for the content descriptor-type for integers (64-bit). |
static int |
TYPE_STRING
Constant for the content descriptor-type for Strings. |
static int |
TYPE_WORD
Constant for the content descriptor-type for integers (16-bit). |
| Constructor Summary | |
|---|---|
ContentDescriptor(java.lang.String propName,
int propType)
Creates an Instance. |
|
| Method Summary | |
|---|---|
java.lang.Object |
clone()
(overridden) |
int |
compareTo(ContentDescriptor o)
|
ContentDescriptor |
createCopy()
This method creates a copy of the current object. |
boolean |
equals(java.lang.Object obj)
(overridden) |
boolean |
getBoolean()
Returns the value of the ContentDescriptor as a Boolean. |
byte[] |
getBytes()
This method will return a byte array, which can directly be written into an "Extended Content Description"-chunk. |
int |
getCurrentAsfSize()
Returns the size (in bytes) this descriptor will take when written to an ASF file. |
java.lang.String |
getName()
This method returns the name of the content descriptor. |
long |
getNumber()
This method returns the value of the content descriptor as an integer. |
byte[] |
getRawData()
This method returns a copy of the content of the descriptor. |
java.lang.String |
getString()
Returns the value of the ContentDescriptor as a String. |
int |
getType()
Returns the type of the content descriptor. |
boolean |
isEmpty()
This method checks if the binary data is empty. |
void |
setBinaryValue(byte[] data)
Sets the Value of the current content descriptor. |
void |
setBooleanValue(boolean value)
Sets the Value of the current content descriptor. |
void |
setDWordValue(long value)
Sets the Value of the current content descriptor. |
void |
setQWordValue(long value)
Sets the Value of the current content descriptor. |
void |
setStringValue(java.lang.String value)
Sets the Value of the current content descriptor. |
void |
setWordValue(int value)
Sets the Value of the current content descriptor. |
java.lang.String |
toString()
(overridden) |
int |
writeInto(java.io.OutputStream out)
Writes this descriptor into the specified output stream. |
| Methods inherited from class java.lang.Object |
|---|
getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final int TYPE_BINARY
public static final int TYPE_BOOLEAN
public static final int TYPE_DWORD
public static final int TYPE_QWORD
public static final int TYPE_STRING
public static final int TYPE_WORD
| Constructor Detail |
|---|
public ContentDescriptor(java.lang.String propName,
int propType)
propName - Name of the ContentDescriptor.propType - Type of the content descriptor. See descriptorType| Method Detail |
|---|
public java.lang.Object clone()
throws java.lang.CloneNotSupportedException
clone in class java.lang.Objectjava.lang.CloneNotSupportedExceptionObject.clone()public int compareTo(ContentDescriptor o)
compareTo in interface java.lang.Comparable<ContentDescriptor>public ContentDescriptor createCopy()
public boolean equals(java.lang.Object obj)
equals in class java.lang.ObjectObject.equals(java.lang.Object)public boolean getBoolean()
true if first byte of contentis not zero.
public byte[] getBytes()
public int getCurrentAsfSize()
public java.lang.String getName()
public long getNumber()
contentto a number.
getType()equals on of the following:
public byte[] getRawData()
public java.lang.String getString()
public int getType()
descriptorTypeTYPE_BINARY,
TYPE_BOOLEAN,
TYPE_DWORD,
TYPE_QWORD,
TYPE_STRING,
TYPE_WORDpublic boolean isEmpty()
true if no value is set.
public void setBinaryValue(byte[] data)
throws java.lang.IllegalArgumentException
descriptorTypeto
TYPE_BINARY.
data - Value to set.
java.lang.IllegalArgumentException - If the byte array is greater that 65535 bytes.public void setBooleanValue(boolean value)
descriptorTypeto
TYPE_BOOLEAN.
value - Value to set.public void setDWordValue(long value)
descriptorTypeto
TYPE_DWORD.
value - Value to set.public void setQWordValue(long value)
descriptorTypeto
TYPE_QWORD
value - Value to set.
public void setStringValue(java.lang.String value)
throws java.lang.IllegalArgumentException
descriptorTypeto
TYPE_STRING.
value - Value to set.
java.lang.IllegalArgumentException - If byte representation would take more than 65535 Bytes.public void setWordValue(int value)
descriptorTypeto
TYPE_WORD
value - Value to set.public java.lang.String toString()
toString in class java.lang.ObjectObject.toString()
public int writeInto(java.io.OutputStream out)
throws java.io.IOException
out - stream to write into.
java.io.IOException - on I/O Errors
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||