Methods Summary |
---|
public void | accept(ID3Visitor oID3Visitor)
oID3Visitor.visitGEOBID3V2Frame(this);
|
public boolean | equals(java.lang.Object oOther)
if ((oOther == null) || (!(oOther instanceof GEOBID3V2Frame)))
{
return false;
}
GEOBID3V2Frame oOtherGEOB = (GEOBID3V2Frame)oOther;
return ( (((m_sMimeType == null) && (oOtherGEOB.m_sMimeType == null)) || m_sMimeType.equals(oOtherGEOB.m_sMimeType)) &&
(((m_sFilename == null) && (oOtherGEOB.m_sFilename == null)) || m_sFilename.equals(oOtherGEOB.m_sFilename)) &&
m_sContentDescription.equals(oOtherGEOB.m_sContentDescription) &&
m_oTextEncoding.equals(oOtherGEOB.m_oTextEncoding) &&
Arrays.equals(m_abyEncapsulatedObjectData, oOtherGEOB.m_abyEncapsulatedObjectData));
|
public java.lang.String | getContentDescription()Get the content description of the object in this frame.
return m_sContentDescription;
|
public byte[] | getEncapsulatedObjectData()Get the encapsulated object data in this frame.
return m_abyEncapsulatedObjectData;
|
public java.lang.String | getFilename()Get the filename of the object in this frame.
return m_sFilename;
|
protected byte[] | getFrameId()
return "GEOB".getBytes();
|
public java.lang.String | getMimeType()Get the mime type of the object in this frame.
return m_sMimeType;
|
public TextEncoding | getTextEncoding()Get the text encoding used for the filename and content description in this frame.
return m_oTextEncoding;
|
public void | setEncapsulatedObject(java.lang.String sMimeType, java.lang.String sFilename, java.lang.String sContentDescription, byte[] abyEncapsulatedObjectData)Set the encapsulated object for this frame.
TextEncoding oOrigTextEncoding = m_oTextEncoding;
String sOrigMimeType = m_sMimeType;
String sOrigFilename = m_sFilename;
String sOrigContentDescription = m_sContentDescription;
byte[] abyOrigEncapsulatedObjectData = m_abyEncapsulatedObjectData;
if ((sContentDescription == null) || (sContentDescription.length() == 0))
{
throw new ID3Exception("Content description is required in GEOB frame.");
}
if ((abyEncapsulatedObjectData == null) || (abyEncapsulatedObjectData.length == 0))
{
throw new ID3Exception("Encapsulated object data is required in GEOB frame.");
}
m_oTextEncoding = TextEncoding.getDefaultTextEncoding();
m_sMimeType = sMimeType;
m_sFilename = sFilename;
m_sContentDescription = sContentDescription;
m_abyEncapsulatedObjectData = abyEncapsulatedObjectData;
// try this update, and reverse it if it generates and error
try
{
notifyID3Observers();
}
catch (ID3Exception e)
{
m_oTextEncoding = oOrigTextEncoding;
m_sMimeType = sOrigMimeType;
m_sFilename = sOrigFilename;
m_sContentDescription = sOrigContentDescription;
m_abyEncapsulatedObjectData = abyOrigEncapsulatedObjectData;
throw e;
}
|
public void | setTextEncoding(TextEncoding oTextEncoding)Set the text encoding to be used for the filename and content description in this frame.
if (oTextEncoding == null)
{
throw new NullPointerException("Text encoding cannot be null.");
}
m_oTextEncoding = oTextEncoding;
|
public java.lang.String | toString()
return "General Encapsulated Object: Mime-Type=[" + m_sMimeType + "], Filename=["
+ m_sFilename + "], Content description=[" + m_sContentDescription +
"], Object data length=" + m_abyEncapsulatedObjectData.length;
|
protected void | writeBody(ID3DataOutputStream oIDOS)
// text encoding
oIDOS.writeUnsignedByte(m_oTextEncoding.getEncodingValue());
// mime type
if (m_sMimeType != null)
{
oIDOS.write(m_sMimeType.getBytes());
}
oIDOS.writeUnsignedByte(0);
// filename
if (m_sFilename != null)
{
oIDOS.write(m_sFilename.getBytes(m_oTextEncoding.getEncodingString()));
}
// null after filename
if (m_oTextEncoding.equals(TextEncoding.ISO_8859_1))
{
oIDOS.writeUnsignedByte(0);
}
else
{
oIDOS.writeUnsignedByte(0);
oIDOS.writeUnsignedByte(0);
}
// content description
oIDOS.write(m_sContentDescription.getBytes(m_oTextEncoding.getEncodingString()));
// null after content description
if (m_oTextEncoding.equals(TextEncoding.ISO_8859_1))
{
oIDOS.writeUnsignedByte(0);
}
else
{
oIDOS.writeUnsignedByte(0);
oIDOS.writeUnsignedByte(0);
}
// actual text of comment
oIDOS.write(m_abyEncapsulatedObjectData);
|