Constructors Summary |
---|
public RBUFID3V2Frame(int i24BufferSize, boolean bEmbeddedInfoFlag, int iOffsetToNextTag)Creates a new instance of RBUFID3V2Frame.
if ((i24BufferSize < 0) || (i24BufferSize > (1<<24)-1))
{
throw new ID3Exception("Buffer size must be an unsigned 24-bit value in RBUF frame.");
}
m_i24BufferSize = i24BufferSize;
m_bEmbeddedInfoFlag = bEmbeddedInfoFlag;
if (iOffsetToNextTag < 0)
{
throw new ID3Exception("Offset to next tag cannot be negative in RBUF frame.");
}
m_iOffsetToNextTag = iOffsetToNextTag;
|
public RBUFID3V2Frame(int i24BufferSize, boolean bEmbeddedInfoFlag)Creates a new instance of RBUFID3V2Frame. (Omitting an offset value.)
if ((i24BufferSize < 0) || (i24BufferSize > (1<<24)-1))
{
throw new ID3Exception("Buffer size must be an unsigned 24-bit value in RBUF frame.");
}
m_i24BufferSize = i24BufferSize;
m_bEmbeddedInfoFlag = bEmbeddedInfoFlag;
m_iOffsetToNextTag = -1;
|
public RBUFID3V2Frame(InputStream oIS)
try
{
ID3DataInputStream oFrameDataID3DIS = new ID3DataInputStream(oIS);
// buffer size (24-bit value)
m_i24BufferSize = oFrameDataID3DIS.readBE24();
// embedded info
int iEmbeddedInfoFlag = oFrameDataID3DIS.readUnsignedByte();
m_bEmbeddedInfoFlag = ((iEmbeddedInfoFlag & 0x01) == 1) ? true : false;
// offset to next tag (optional)
if (oFrameDataID3DIS.available() > 0)
{
if (oFrameDataID3DIS.available() == 4)
{
m_iOffsetToNextTag = oFrameDataID3DIS.readBE32();
}
else
{
// too many bytes left
throw new ID3Exception("RBUF frame data longer than expected.");
}
}
else
{
// no offset to next tag
m_iOffsetToNextTag = -1;
}
}
catch (Exception e)
{
throw new InvalidFrameID3Exception(e);
}
|
Methods Summary |
---|
public void | accept(ID3Visitor oID3Visitor)
oID3Visitor.visitRBUFID3V2Frame(this);
|
public boolean | equals(java.lang.Object oOther)
if ((oOther == null) || (!(oOther instanceof RBUFID3V2Frame)))
{
return false;
}
RBUFID3V2Frame oOtherRBUF = (RBUFID3V2Frame)oOther;
return ((m_i24BufferSize == oOtherRBUF.m_i24BufferSize) &&
(m_bEmbeddedInfoFlag == oOtherRBUF.m_bEmbeddedInfoFlag) &&
(m_iOffsetToNextTag == oOtherRBUF.m_iOffsetToNextTag));
|
public int | getBufferSize()Get recommended buffer size.
return m_i24BufferSize;
|
public boolean | getEmbeddedInfoFlag()Get the embedded info flag.
return m_bEmbeddedInfoFlag;
|
protected byte[] | getFrameId()
return "RBUF".getBytes();
|
public int | getOffsetToNextTag()Get the offset to the next tag.
return m_iOffsetToNextTag;
|
public void | setRecommendedBufferSize(int i24BufferSize, boolean bEmbeddedInfoFlag, int iOffsetToNextTag)Set the recommended buffer size.
if ((i24BufferSize < 0) || (i24BufferSize > (1<<24)-1))
{
throw new ID3Exception("Buffer size must be an unsigned 24-bit value in RBUF frame.");
}
m_i24BufferSize = i24BufferSize;
m_bEmbeddedInfoFlag = bEmbeddedInfoFlag;
if (iOffsetToNextTag < 0)
{
throw new ID3Exception("Offset to next tag cannot be negative in RBUF frame.");
}
m_iOffsetToNextTag = iOffsetToNextTag;
|
public void | setRecommendedBufferSize(int i24BufferSize, boolean bEmbeddedInfoFlag)Set the recommended buffer size. (Omitting an offset value.)
if ((i24BufferSize < 0) || (i24BufferSize > (1<<24)-1))
{
throw new ID3Exception("Buffer size must be an unsigned 24-bit value in RBUF frame.");
}
m_i24BufferSize = i24BufferSize;
m_bEmbeddedInfoFlag = bEmbeddedInfoFlag;
m_iOffsetToNextTag = -1;
|
public java.lang.String | toString()
return "Recommended buffer size: Buffer size=[" + m_i24BufferSize + "], Embedded info flag=" + m_bEmbeddedInfoFlag +
"], Offset to next tag=[" + m_iOffsetToNextTag + "]";
|
protected void | writeBody(ID3DataOutputStream oIDOS)
// recommended buffer size
oIDOS.writeBE24(m_i24BufferSize);
// embedded info flag
oIDOS.writeUnsignedByte(m_bEmbeddedInfoFlag ? 1 : 0);
// offset to next tag
if (m_iOffsetToNextTag >= 0)
{
oIDOS.writeBE32(m_iOffsetToNextTag);
}
|