de.axelwernicke.mypod.ipod
Class ITunesDBParser

java.lang.Object
  extended byde.axelwernicke.mypod.ipod.ITunesDBParser

public class ITunesDBParser
extends java.lang.Object

Represents an iTunes Database, which contains clip and playlist information.

Author:
axelwe

Constructor Summary
ITunesDBParser()
          Creates a new instance of a parser
ITunesDBParser(ITunesDB _db)
          Creates a new instance of ITunesDB
 
Method Summary
static long dateToMacDate(long javaDate)
          Converts a java date as long to a mac date as long mac date is seconds since 01/01/1904 java date is milliseconds since 01/01/1970
static long macDateToDate(long macDate)
          Converts a date as long from iPod to a java date as long mac date is seconds since 01/01/1904 java date is milliseconds since 01/01/1970
static byte[] stringToUTF16LittleEndian(java.lang.String value)
          Converts a java String to an UTF16 little endianed byte array
static java.lang.String uTF16LittleEndianToString(byte[] value)
          Converts a little endianed UTF16 byte array into a java string.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ITunesDBParser

public ITunesDBParser()
Creates a new instance of a parser


ITunesDBParser

public ITunesDBParser(ITunesDB _db)
Creates a new instance of ITunesDB

Parameters:
_db - database to create a parser for
Method Detail

uTF16LittleEndianToString

public static java.lang.String uTF16LittleEndianToString(byte[] value)
Converts a little endianed UTF16 byte array into a java string.

Parameters:
value - byte array to decode
Returns:
string representing the decoded value

stringToUTF16LittleEndian

public static byte[] stringToUTF16LittleEndian(java.lang.String value)
Converts a java String to an UTF16 little endianed byte array

Parameters:
value - string to convert
Returns:
byte array containing the encoded value

macDateToDate

public static long macDateToDate(long macDate)
Converts a date as long from iPod to a java date as long
 mac date is seconds since 01/01/1904
 java date is milliseconds since 01/01/1970
 

Parameters:
macDate - date on iPod
Returns:
date in java format

dateToMacDate

public static long dateToMacDate(long javaDate)
Converts a java date as long to a mac date as long
 mac date is seconds since 01/01/1904
 java date is milliseconds since 01/01/1970
 

Parameters:
javaDate - date in java format
Returns:
date in mac format