FileDocCategorySizeDatePackage
TSIZTextInformationID3V2Frame.javaAPI Docjid3 0.464087Sun Feb 06 18:11:22 GMT 2005org.blinkenlights.jid3.v2

TSIZTextInformationID3V2Frame

public class TSIZTextInformationID3V2Frame extends TextInformationID3V2Frame
author
paul Text frame containing the size of the tagged audio file in bytes, not counting the tag length.

Fields Summary
private int
m_iSizeInBytes
Constructors Summary
public TSIZTextInformationID3V2Frame(int iSizeInBytes)
Constructor.

param
iSizeInBytes the size in bytes, of the tagged audio file, not counting the tag length
throws
ID3Exception if the size is negative

        super(Integer.toString(iSizeInBytes));
        
        if (iSizeInBytes < 0)
        {
            throw new ID3Exception("Size value cannot be negative.");
        }
        
        m_iSizeInBytes = iSizeInBytes;
    
public TSIZTextInformationID3V2Frame(InputStream oIS)

        super(oIS);
        
        try
        {
            m_iSizeInBytes = Integer.parseInt(m_sInformation);
        }
        catch (Exception e)
        {
            throw new InvalidFrameID3Exception("Encountered a corrupt TSIZ file size frame.", e);
        }
    
Methods Summary
public voidaccept(ID3Visitor oID3Visitor)

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

        if ((oOther == null) || (!(oOther instanceof TSIZTextInformationID3V2Frame)))
        {
            return false;
        }
        
        TSIZTextInformationID3V2Frame oOtherTSIZ = (TSIZTextInformationID3V2Frame)oOther;
        
        return ((m_iSizeInBytes == oOtherTSIZ.m_iSizeInBytes) &&
                m_oTextEncoding.equals(oOtherTSIZ.m_oTextEncoding) &&
                m_sInformation.equals(oOtherTSIZ.m_sInformation));
    
protected byte[]getFrameId()

        return "TSIZ".getBytes();
    
public intgetSizeInBytes()
Get the size in bytes, of the tagged file, not counting the tag length.

return
the specified size in bytes, of the tagged file, not counting the tag length

        return m_iSizeInBytes;
    
public voidsetSizeInBytes(int iSizeInBytes)
Set the size in bytes, of the tagged audio file, not counting the tag length.

param
iSizeInBytes the size in bytes, of the tagged audio file, not counting the tag length
throws
ID3Exception if the size is negative

        if (iSizeInBytes < 0)
        {
            throw new ID3Exception("Size value cannot be negative.");
        }
        
        m_iSizeInBytes = iSizeInBytes;
        m_oTextEncoding = TextEncoding.getDefaultTextEncoding();
        m_sInformation = Integer.toString(iSizeInBytes);
    
public java.lang.StringtoString()

        return "Size (in bytes excluding tags): [" + m_sInformation + "]";