|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jaudiotagger.tag.datatype.AbstractDataType org.jaudiotagger.tag.datatype.AbstractString org.jaudiotagger.tag.datatype.TextEncodedStringSizeTerminated
public class TextEncodedStringSizeTerminated
Represents a String which is not delimited by null character.
This type of String will usually only be used when it is the last field within a frame, when reading the remainder of the byte array will be read, when writing the frame will be accomodate the required size for the String. The String will be encoded based upon the text encoding of the frame that it belongs to. All TextInformation frames support multiple strings, stored as a null separated list, where null is represented by the termination code for the character encoding. This functionality is only officially support in ID3v24. Itunes write null terminators characters after the String even though it only writes a single value.
Field Summary |
---|
Fields inherited from class org.jaudiotagger.tag.datatype.AbstractDataType |
---|
frameBody, identifier, logger, size, TYPE_ELEMENT, value |
Constructor Summary | |
---|---|
TextEncodedStringSizeTerminated(java.lang.String identifier,
AbstractTagFrameBody frameBody)
Creates a new empty TextEncodedStringSizeTerminated datatype. |
|
TextEncodedStringSizeTerminated(TextEncodedStringSizeTerminated object)
Copy constructor |
Method Summary | |
---|---|
void |
addValue(java.lang.String value)
Add an additional String to the current String value |
boolean |
equals(java.lang.Object obj)
|
int |
getNumberOfValues()
How many values are held, each value is seperated by a null terminator |
protected java.lang.String |
getTextEncodingCharSet()
Get the text encoding being used. |
java.lang.String |
getValueAtIndex(int index)
Get the nth value |
void |
readByteArray(byte[] arr,
int offset)
Read a 'n' bytes from buffer into a String where n is the framesize - offset so thefore cannot use this if there are other objects after it because it has no delimiter. |
private static java.util.List |
splitByNullSeperator(java.lang.String value)
Split the values seperated by null character |
byte[] |
writeByteArray()
Write String into byte array It will remove a trailing null terminator if exists if the option RemoveTrailingTerminatorOnWrite has been set. |
Methods inherited from class org.jaudiotagger.tag.datatype.AbstractString |
---|
canBeEncoded, getSize, setSize, toString |
Methods inherited from class org.jaudiotagger.tag.datatype.AbstractDataType |
---|
createStructure, getBody, getIdentifier, getValue, readByteArray, setBody, setValue |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public TextEncodedStringSizeTerminated(java.lang.String identifier, AbstractTagFrameBody frameBody)
identifier
- identifies the frame typeframeBody
- public TextEncodedStringSizeTerminated(TextEncodedStringSizeTerminated object)
object
- Method Detail |
---|
public boolean equals(java.lang.Object obj)
equals
in class AbstractDataType
public void readByteArray(byte[] arr, int offset) throws InvalidDataTypeException
readByteArray
in class AbstractDataType
arr
- this is the buffer for the frameoffset
- this is where to start reading in the buffer for this field
java.lang.NullPointerException
java.lang.IndexOutOfBoundsException
InvalidDataTypeException
public byte[] writeByteArray()
writeByteArray
in class AbstractDataType
protected java.lang.String getTextEncodingCharSet()
private static java.util.List splitByNullSeperator(java.lang.String value)
value
- the raw value
public void addValue(java.lang.String value)
value
- public int getNumberOfValues()
public java.lang.String getValueAtIndex(int index)
index
-
java.lang.IndexOutOfBoundsException
- if value does not exist
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |