TextInformationID3V2Framepublic abstract class TextInformationID3V2Frame extends ID3V2Frame
Fields Summary |
---|
protected TextEncoding | m_oTextEncodingThe text encoding of the strings in this frame. | protected String | m_sInformationThe text content of this frame. Based on the type of frame, there will be different
meanings, and potentailly unique restrictions, for this value. |
Constructors Summary |
---|
protected TextInformationID3V2Frame()
m_oTextEncoding = TextEncoding.getDefaultTextEncoding();
| protected TextInformationID3V2Frame(TextEncoding oTextEncoding, String sInformation)Constructor for user created frames.
// set the text and its encoding type for this text information frame
m_oTextEncoding = oTextEncoding;
m_sInformation = sInformation;
| protected TextInformationID3V2Frame(String sInformation)Constructor for user created frames. Uses the current default text encoding.
// set the text and its encoding type for this text information frame
m_oTextEncoding = TextEncoding.getDefaultTextEncoding();
m_sInformation = sInformation;
| public TextInformationID3V2Frame(InputStream oIS)Constructor to be used internally when reading frames from a file.
// Parse out the text encoding and text string from the raw data
try
{
ID3DataInputStream oFrameDataID3DIS = new ID3DataInputStream(oIS);
m_oTextEncoding = TextEncoding.getTextEncoding(oFrameDataID3DIS.readUnsignedByte());
byte[] abyInformation = new byte[oFrameDataID3DIS.available()];
oFrameDataID3DIS.readFully(abyInformation);
m_sInformation = new String(abyInformation, m_oTextEncoding.getEncodingString());
}
catch (Exception e)
{
throw new InvalidFrameID3Exception(e);
}
|
Methods Summary |
---|
public TextEncoding | getTextEncoding()Get the text encoding used for the text information in this frame.
return m_oTextEncoding;
| public void | setTextEncoding(TextEncoding oTextEncoding)Set the text encoding to be used for the text information in this frame.
if (oTextEncoding == null)
{
throw new NullPointerException("Text encoding cannot be null.");
}
m_oTextEncoding = oTextEncoding;
| protected void | writeBody(ID3DataOutputStream oIDOS)Write the body of this frame to an output stream.
oIDOS.writeUnsignedByte(m_oTextEncoding.getEncodingValue());
oIDOS.write(m_sInformation.getBytes(m_oTextEncoding.getEncodingString()));
|
|