FileDocCategorySizeDatePackage
MCDIID3V2Frame.javaAPI Docjid3 0.463527Sun Feb 06 18:11:23 GMT 2005org.blinkenlights.jid3.v2

MCDIID3V2Frame

public class MCDIID3V2Frame extends ID3V2Frame
author
paul Frame containing CD identification data.

Fields Summary
private byte[]
m_abyCDTOC
Constructors Summary
public MCDIID3V2Frame(byte[] abyCDTOC)
Constructor.

param
abyCDTOC CD identification data, by which the CD this track came from can be identified
throws
ID3Exception if abyCDTOC is null, zero-length, or greater than 804 bytes in length


                                        
      
         
    
        m_abyCDTOC = abyCDTOC;
        
        // cd toc
        if ((abyCDTOC == null) || (abyCDTOC.length == 0))
        {
            throw new ID3Exception("MCDI frame requires CD TOC data.");
        }
        if (abyCDTOC.length > 804)
        {
            throw new ID3Exception("MCDI frame CD TOC data cannot exceed 804 bytes.");
        }
        m_abyCDTOC = abyCDTOC;
    
public MCDIID3V2Frame(InputStream oIS)

        try
        {
            ID3DataInputStream oFrameDataID3DIS = new ID3DataInputStream(oIS);
            
            // cd toc
            m_abyCDTOC = new byte[oFrameDataID3DIS.available()];
            oFrameDataID3DIS.readFully(m_abyCDTOC);
        }
        catch (Exception e)
        {
            throw new InvalidFrameID3Exception(e);
        }
    
Methods Summary
public voidaccept(ID3Visitor oID3Visitor)

        oID3Visitor.visitMCDIID3V2Frame(this);
    
public booleanequals(java.lang.Object oOther)

        if ((oOther == null) || (!(oOther instanceof MCDIID3V2Frame)))
        {
            return false;
        }
        
        MCDIID3V2Frame oOtherMCDI = (MCDIID3V2Frame)oOther;
        
        return (Arrays.equals(m_abyCDTOC, oOtherMCDI.m_abyCDTOC));
    
public byte[]getCDTOCData()
Get CD identification data.

return
an array of bytes which can identify the CD which this track comes from

        return m_abyCDTOC;
    
protected byte[]getFrameId()

        return "MCDI".getBytes();
    
public java.lang.StringtoString()

        return "Music CD Identifier: CD TOC length=" + m_abyCDTOC.length;
    
protected voidwriteBody(ID3DataOutputStream oIDOS)

        // cd toc data
        oIDOS.write(m_abyCDTOC);