Methods Summary |
---|
public void | accept(ID3Visitor oID3Visitor)
oID3Visitor.visitLINKID3V2Frame(this);
|
public boolean | equals(java.lang.Object oOther)
if ((oOther == null) || (!(oOther instanceof LINKID3V2Frame)))
{
return false;
}
LINKID3V2Frame oOtherLINK = (LINKID3V2Frame)oOther;
return ( Arrays.equals(m_abyFrameIdentifier, oOtherLINK.m_abyFrameIdentifier) &&
(((m_sURL == null) && (oOtherLINK.m_sURL == null)) || m_sURL.equals(oOtherLINK.m_sURL)) &&
m_sAdditionalData.equals(oOtherLINK.m_sAdditionalData) );
|
public java.lang.String | getAdditionalData()Get any additional link-related data in this frame.
return m_sAdditionalData;
|
protected byte[] | getFrameId()
return "LINK".getBytes();
|
public byte[] | getFrameIdentifier()Get the frame identifier of the linked frame.
return m_abyFrameIdentifier;
|
public java.lang.String | getLinkUrl()Get the URL pointing to the location of the file containing the linked frame.
return m_sURL;
|
public void | setContents(byte[] abyFrameIdentifier, java.lang.String sURL, java.lang.String sAdditionalData)Set the contents of this frame.
byte[] abyOrigFrameIdentifier = m_abyFrameIdentifier;
String sOrigURL = m_sURL;
String sOrigAdditionalData = m_sAdditionalData;
if (abyFrameIdentifier == null)
{
throw new ID3Exception("LINK frame requires frame identifier.");
}
if (abyFrameIdentifier.length != 4)
{
throw new ID3Exception("Frame identifiers must be four bytes in length in LINK frame.");
}
if ((sURL == null) || (sURL.length() == 0))
{
throw new ID3Exception("LINK frame requires an URL.");
}
m_abyFrameIdentifier = abyFrameIdentifier;
m_sURL = sURL;
m_sAdditionalData = sAdditionalData;
// try this update, and reverse it if it generates and error
try
{
notifyID3Observers();
}
catch (ID3Exception e)
{
m_abyFrameIdentifier = abyOrigFrameIdentifier;
m_sURL = sOrigURL;
m_sAdditionalData = sOrigAdditionalData;
throw e;
}
|
public java.lang.String | toString()
StringBuffer sbOutput = new StringBuffer();
sbOutput.append("Link: Frame identifier=[" + ID3Util.convertBytesToHexString(m_abyFrameIdentifier, true) +
"], URL=[" + m_sURL + "], Additional data=[" + m_sAdditionalData + "]");
return sbOutput.toString();
|
protected void | writeBody(ID3DataOutputStream oIDOS)
// frame identifier
oIDOS.write(m_abyFrameIdentifier);
// url
oIDOS.write(m_sURL.getBytes());
oIDOS.writeUnsignedByte(0);
// additional data
oIDOS.write(m_sAdditionalData.getBytes());
|