org.jaudiotagger.tag.datatype
Class TextEncodedStringNullTerminated
java.lang.Object
org.jaudiotagger.tag.datatype.AbstractDataType
org.jaudiotagger.tag.datatype.AbstractString
org.jaudiotagger.tag.datatype.TextEncodedStringNullTerminated
- Direct Known Subclasses:
- StringNullTerminated
public class TextEncodedStringNullTerminated
- extends AbstractString
Represents a String whose size is determined by finding of a null character at the end of the String.
The String itself might be of length zero (i.e just consist of the null character). The String will be encoded based
upon the text encoding of the frame that it belongs to.
Method Summary |
boolean |
equals(java.lang.Object obj)
|
protected java.lang.String |
getTextEncodingCharSet()
|
void |
readByteArray(byte[] arr,
int offset)
Read a string from buffer upto null character (if exists)
Must take into account the text encoding defined in the Encoding Object
ID3 Text Frames often allow multiple strings seperated by the null char
appropriate for the encoding. |
byte[] |
writeByteArray()
Write String into byte array, adding a null character to the end of the String |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
TextEncodedStringNullTerminated
public TextEncodedStringNullTerminated(java.lang.String identifier,
AbstractTagFrameBody frameBody)
- Creates a new TextEncodedStringNullTerminated datatype.
- Parameters:
identifier
- identifies the frame typeframeBody
-
TextEncodedStringNullTerminated
public TextEncodedStringNullTerminated(java.lang.String identifier,
AbstractTagFrameBody frameBody,
java.lang.String value)
- Creates a new TextEncodedStringNullTerminated datatype, with value
- Parameters:
identifier
- frameBody
- value
-
TextEncodedStringNullTerminated
public TextEncodedStringNullTerminated(TextEncodedStringNullTerminated object)
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in class AbstractDataType
- Returns:
- whether this and obj are deemed equivalent
readByteArray
public void readByteArray(byte[] arr,
int offset)
throws InvalidDataTypeException
- Read a string from buffer upto null character (if exists)
Must take into account the text encoding defined in the Encoding Object
ID3 Text Frames often allow multiple strings seperated by the null char
appropriate for the encoding.
- Specified by:
readByteArray
in class AbstractDataType
- Parameters:
arr
- this is the buffer for the frameoffset
- this is where to start reading in the buffer for this field
- Throws:
InvalidDataTypeException
writeByteArray
public byte[] writeByteArray()
- Write String into byte array, adding a null character to the end of the String
- Specified by:
writeByteArray
in class AbstractDataType
- Returns:
- the data as a byte array in format to write to file
getTextEncodingCharSet
protected java.lang.String getTextEncodingCharSet()