FileDocCategorySizeDatePackage
UrlLinkID3V2Frame.javaAPI Docjid3 0.463626Thu May 05 06:13:35 BST 2005org.blinkenlights.jid3.v2

UrlLinkID3V2Frame

public abstract class UrlLinkID3V2Frame extends ID3V2Frame
author
paul The base class for all URL frames.

Fields Summary
protected String
m_sURL
The URL content for this frame, represented as a string. This class will not throw an exception if an invalid URL is specified, to ensure compatibility with broken implementations, so a string, rather than an URL, is used to store the value.
Constructors Summary
public UrlLinkID3V2Frame()

    
     
    
    
public UrlLinkID3V2Frame(String sURL)
Constructor for user created frames.

param
sURL the raw URL text to be stored in this frame when it is written
throws
ID3Exception if the URL passed is null

        if (sURL == null)
        {
            throw new ID3Exception("URL in an URL link ID3 V2 frame cannot be null.");
        }
        
        m_sURL = sURL;
    
public UrlLinkID3V2Frame(URL oURL)
Constructor for user created frames.

param
oURL the raw URL from which text is to be stored in this frame when it is written
throws
ID3Exception if the URL passed is null

        if (oURL == null)
        {
            throw new ID3Exception("URL in an URL link ID3 V2 frame cannot be null.");
        }
        
        m_sURL = oURL.toExternalForm();
    
public UrlLinkID3V2Frame(InputStream oIS)
Constructor to be used internally when reading frames from a file.

throws
ID3Exception if there is any error parsing the URL frame data

        try
        {
            ID3DataInputStream oFrameDataID3DIS = new ID3DataInputStream(oIS);

            // URL (ignore anything after a null)
            byte[] abyUrl = new byte[oFrameDataID3DIS.available()];
            oFrameDataID3DIS.readFully(abyUrl);
            m_sURL = new String(abyUrl);
        }
        catch (Exception e)
        {
            throw new InvalidFrameID3Exception(e);
        }
    
Methods Summary
protected voidwriteBody(ID3DataOutputStream oIDOS)
Write the body of this frame to an output stream.

param
oIDOS the ID3 output stream to which the frame body is to be written
throws
ID3Exception if there is any error writing the frame body data

        oIDOS.write(m_sURL.getBytes());