super(oIS);
// convert information string to ISO-8859-1 encoding before parsing (we only accept ISO-8559-1 chars anyway)
byte[] abyInformation = null;
try
{
abyInformation = m_sInformation.getBytes("ISO-8859-1");
}
catch (Exception e)
{
throw new InvalidFrameID3Exception("Encountered a TIME frame in which the time digits cannot be parsed.", e);
}
// time must be four characters
if (abyInformation.length != 4)
{
throw new InvalidFrameID3Exception("Encountered a corrupt TIME frame with time string length not equal to four.");
}
// try to parse hours and minutes (we aren't going to require valid times when reading from a file,
// but they do have to be numbers)
try
{
byte[] abyHours = { abyInformation[0], abyInformation[1] };
byte[] abyMinutes = { abyInformation[2], abyInformation[3] };
m_iHours = Integer.parseInt(new String(abyHours));
m_iMinutes = Integer.parseInt(new String(abyMinutes));
}
catch (Exception e)
{
throw new InvalidFrameID3Exception("Encountered a corrupt TIME frame.", e);
}