org.jaudiotagger.tag.datatype
Class ByteArraySizeTerminated

java.lang.Object
  extended by org.jaudiotagger.tag.datatype.AbstractDataType
      extended by org.jaudiotagger.tag.datatype.ByteArraySizeTerminated

public class ByteArraySizeTerminated
extends AbstractDataType

Represents a stream of bytes, continuing until the end of the buffer. Usually used for binary data or where we havent yet mapped the data to a better fitting type.


Field Summary
 
Fields inherited from class org.jaudiotagger.tag.datatype.AbstractDataType
frameBody, identifier, logger, size, TYPE_ELEMENT, value
 
Constructor Summary
ByteArraySizeTerminated(ByteArraySizeTerminated object)
           
ByteArraySizeTerminated(java.lang.String identifier, AbstractTagFrameBody frameBody)
           
 
Method Summary
 boolean equals(java.lang.Object obj)
           
 int getSize()
          Return the size in byte of this datatype
 void readByteArray(byte[] arr, int offset)
          This is the starting point for reading bytes from the file into the ID3 datatype starting at offset.
 java.lang.String toString()
          Because this is usually binary data and could be very long we just return the number of bytes held
 byte[] writeByteArray()
          Write contents to a byte array
 
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

ByteArraySizeTerminated

public ByteArraySizeTerminated(java.lang.String identifier,
                               AbstractTagFrameBody frameBody)

ByteArraySizeTerminated

public ByteArraySizeTerminated(ByteArraySizeTerminated object)
Method Detail

getSize

public int getSize()
Return the size in byte of this datatype

Specified by:
getSize in class AbstractDataType
Returns:
the size in bytes

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
Description copied from class: AbstractDataType
This is the starting point for reading bytes from the file into the ID3 datatype starting at offset. This class must be overridden

Specified by:
readByteArray in class AbstractDataType
Parameters:
arr -
offset -
Throws:
java.lang.NullPointerException
java.lang.IndexOutOfBoundsException
InvalidDataTypeException

toString

public java.lang.String toString()
Because this is usually binary data and could be very long we just return the number of bytes held

Overrides:
toString in class java.lang.Object
Returns:
the number of bytes

writeByteArray

public byte[] writeByteArray()
Write contents to a byte array

Specified by:
writeByteArray in class AbstractDataType
Returns:
a byte array that that contians the data that should be perisisted to file