org.jaudiotagger.tag.datatype
Class MultipleTextEncodedStringNullTerminated

java.lang.Object
  extended by org.jaudiotagger.tag.datatype.AbstractDataType
      extended by org.jaudiotagger.tag.datatype.MultipleTextEncodedStringNullTerminated
Direct Known Subclasses:
PairedTextEncodedStringNullTerminated

public class MultipleTextEncodedStringNullTerminated
extends AbstractDataType

Represents a datatype that supports multiple terminated Strings (there may only be one)


Nested Class Summary
static class MultipleTextEncodedStringNullTerminated.Values
          This holds the values held by a MultipleTextEncodedDatatype
 
Field Summary
 
Fields inherited from class org.jaudiotagger.tag.datatype.AbstractDataType
frameBody, identifier, logger, size, TYPE_ELEMENT, value
 
Constructor Summary
MultipleTextEncodedStringNullTerminated(MultipleTextEncodedStringNullTerminated object)
           
MultipleTextEncodedStringNullTerminated(java.lang.String identifier, AbstractTagFrameBody frameBody)
          Creates a new ObjectStringSizeTerminated datatype.
MultipleTextEncodedStringNullTerminated(TextEncodedStringSizeTerminated object)
           
 
Method Summary
 boolean canBeEncoded()
          Check the value can be encoded with the specified encoding
 boolean equals(java.lang.Object obj)
           
 int getSize()
          Returns the size in bytes of this datatype when written to file
 void readByteArray(byte[] arr, int offset)
          Read Null Terminated Strings from the array starting at offset, continue until unable to find any null terminated Strings or until reached the end of the array.
 byte[] writeByteArray()
          For every String write to bytebuffer
 
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, toString, wait, wait, wait
 

Constructor Detail

MultipleTextEncodedStringNullTerminated

public MultipleTextEncodedStringNullTerminated(java.lang.String identifier,
                                               AbstractTagFrameBody frameBody)
Creates a new ObjectStringSizeTerminated datatype.

Parameters:
identifier - identifies the frame type
frameBody -

MultipleTextEncodedStringNullTerminated

public MultipleTextEncodedStringNullTerminated(TextEncodedStringSizeTerminated object)

MultipleTextEncodedStringNullTerminated

public MultipleTextEncodedStringNullTerminated(MultipleTextEncodedStringNullTerminated object)
Method Detail

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class AbstractDataType
Returns:
whether this and obj are deemed equivalent

getSize

public int getSize()
Returns the size in bytes of this datatype when written to file

Specified by:
getSize in class AbstractDataType
Returns:
size of this datatype

canBeEncoded

public boolean canBeEncoded()
Check the value can be encoded with the specified encoding

Returns:

readByteArray

public void readByteArray(byte[] arr,
                          int offset)
                   throws InvalidDataTypeException
Read Null Terminated Strings from the array starting at offset, continue until unable to find any null terminated Strings or until reached the end of the array. The offset should be set to byte after the last null terminated String found.

Specified by:
readByteArray in class AbstractDataType
Parameters:
arr - to read the Strings from
offset - in the array to start reading from
Throws:
InvalidDataTypeException - if unable to find any null terminated Strings

writeByteArray

public byte[] writeByteArray()
For every String write to bytebuffer

Specified by:
writeByteArray in class AbstractDataType
Returns:
bytebuffer that should be written to file to persist this datatype.