Methods Summary |
---|
public void | accept(ID3Visitor oID3Visitor)
oID3Visitor.visitENCRID3V2Frame(this);
|
public boolean | equals(java.lang.Object oOther)
if ((oOther == null) || (!(oOther instanceof ENCRID3V2Frame)))
{
return false;
}
ENCRID3V2Frame oOtherENCR = (ENCRID3V2Frame)oOther;
return (m_sOwnerIdentifier.equals(oOtherENCR.m_sOwnerIdentifier) &&
(m_byMethodSymbol == oOtherENCR.m_byMethodSymbol) &&
Arrays.equals(m_abyEncryptionData, oOtherENCR.m_abyEncryptionData));
|
public byte[] | getEncryptionData()Get additional encryption data for this method.
return m_abyEncryptionData;
|
public byte | getEncryptionMethodSymbol()Get the symbol used for this encryption method in this file.
return m_byMethodSymbol;
|
protected byte[] | getFrameId()
return "ENCR".getBytes();
|
public java.lang.String | getOwnerIdentifier()Get the owner identifier for this encryption method.
return m_sOwnerIdentifier;
|
public void | setEncryptionDetails(java.lang.String sOwnerIdentifier, byte byMethodSymbol, byte[] abyEncryptionData)Set details for this encryption frame.
String sOrigOwnerIdentifier = m_sOwnerIdentifier;
byte byOrigMethodSymbol = m_byMethodSymbol;
byte[] abyOrigEncryptionData = m_abyEncryptionData;
if (sOwnerIdentifier == null)
{
throw new ID3Exception("ENCR frame requires owner identifier string.");
}
if ((byMethodSymbol & 0xff) < 0x80)
{
throw new ID3Exception("Encryption method symbols below 0x80 are reserved.");
}
// owner identifier
m_sOwnerIdentifier = sOwnerIdentifier;
// method symbol
m_byMethodSymbol = byMethodSymbol;
// encryption data
m_abyEncryptionData = abyEncryptionData;
// try this update, and reverse it if it generates and error
try
{
notifyID3Observers();
}
catch (ID3Exception e)
{
m_sOwnerIdentifier = sOrigOwnerIdentifier;
m_byMethodSymbol = byOrigMethodSymbol;
m_abyEncryptionData = abyOrigEncryptionData;
throw e;
}
|
public java.lang.String | toString()
return "Encryption Method Registration: Owner identifier=[" + m_sOwnerIdentifier +
"], Method Symbol=[" + m_byMethodSymbol + "]";
|
protected void | writeBody(ID3DataOutputStream oIDOS)
// owner identifier (and terminating null)
oIDOS.write(m_sOwnerIdentifier.getBytes());
oIDOS.writeUnsignedByte(0);
// method symbol
oIDOS.writeUnsignedByte(m_byMethodSymbol);
// encryption data
if (m_abyEncryptionData != null)
{
oIDOS.write(m_abyEncryptionData);
}
|