ID3v2LyricLinepublic class ID3v2LyricLine extends AbstractDataType
Fields Summary |
---|
String | text | long | timeStamp |
Methods Summary |
---|
public boolean | equals(java.lang.Object obj)
if (!(obj instanceof ID3v2LyricLine))
{
return false;
}
ID3v2LyricLine object = (ID3v2LyricLine) obj;
if (!this.text.equals(object.text))
{
return false;
}
return this.timeStamp == object.timeStamp && super.equals(obj);
| public int | getSize()
return text.length() + 1 + 4;
| public java.lang.String | getText()
return text;
| public long | getTimeStamp()
return timeStamp;
| public void | readByteArray(byte[] arr, int offset)
if (arr == null)
{
throw new NullPointerException("Byte array is null");
}
if ((offset < 0) || (offset >= arr.length))
{
throw new IndexOutOfBoundsException("Offset to byte array is out of bounds: offset = " + offset + ", array.length = " + arr.length);
}
//offset += ();
text = Utils.getString(arr, offset, arr.length - offset - 4, "ISO-8859-1");
//text = text.substring(0, text.length() - 5);
timeStamp = 0;
for (int i = arr.length - 4; i < arr.length; i++)
{
timeStamp <<= 8;
timeStamp += arr[i];
}
| public void | setText(java.lang.String text)
this.text = text;
| public void | setTimeStamp(long timeStamp)
this.timeStamp = timeStamp;
| public java.lang.String | toString()
return timeStamp + " " + text;
| public byte[] | writeByteArray()
int i;
byte[] arr = new byte[getSize()];
for (i = 0; i < text.length(); i++)
{
arr[i] = (byte) text.charAt(i);
}
arr[i++] = 0;
arr[i++] = (byte) ((timeStamp & 0xFF000000) >> 24);
arr[i++] = (byte) ((timeStamp & 0x00FF0000) >> 16);
arr[i++] = (byte) ((timeStamp & 0x0000FF00) >> 8);
arr[i++] = (byte) (timeStamp & 0x000000FF);
return arr;
|
|