org.farng.mp3.object
Class AbstractTextObject

java.lang.Object
  extended by org.farng.mp3.object.AbstractMP3Object
      extended by org.farng.mp3.object.AbstractTextObject
All Implemented Interfaces:
MP3Object
Direct Known Subclasses:
ObjectStringFixedLength, ObjectStringNullTerminated, ObjectStringSizeTerminated

public abstract class AbstractTextObject
extends AbstractMP3Object

Base implementation for text-based text objects, to handle text encoding.

Version:
$Revision: 3 $ $Date: 2008-12-27 08:09:28 +1300 (Sat, 27 Dec 2008) $
Author:
Matt Magoffin (spamsqr@msqr.us)

Field Summary
 
Fields inherited from class org.farng.mp3.object.AbstractMP3Object
identifier, value
 
Constructor Summary
AbstractTextObject()
           
AbstractTextObject(AbstractTextObject copy)
           
 
Method Summary
 void readByteArray(byte[] data, int offset)
          Read a String from a byte array.
protected  void readString(byte[] data, int offset, java.lang.String javaEncoding)
          Read a String from offset to the length of the data array.
 
Methods inherited from class org.farng.mp3.object.AbstractMP3Object
equals, getIdentifier, getValue, readByteArray, readString, readString, setValue, writeByteArray, writeString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.farng.mp3.object.MP3Object
getSize, toString
 

Constructor Detail

AbstractTextObject

public AbstractTextObject()

AbstractTextObject

public AbstractTextObject(AbstractTextObject copy)
Method Detail

readByteArray

public void readByteArray(byte[] data,
                          int offset)
Read a String from a byte array.

The byte at offset - 1 will be used as the encoding flag bit.

Overrides:
readByteArray in class AbstractMP3Object
Parameters:
data - the input data
offset - the input offset

readString

protected void readString(byte[] data,
                          int offset,
                          java.lang.String javaEncoding)
Read a String from offset to the length of the data array.

This method will look for a null character, and return the substring up to that character if found.

Parameters:
data - the input data
offset - the starting offset
javaEncoding - the text encoding