Package org.apache.tika.parser.mp3
Class LyricsHandler
- java.lang.Object
-
- org.apache.tika.parser.mp3.LyricsHandler
-
public class LyricsHandler extends Object
This is used to parse Lyrics3 tag information from an MP3 file, if available. Handles lyrics tags of up to 10kb in size. Will process any ID3v1 tag data if present. Ignores extended ID3v1 data in the lyrics block- See Also:
- Lyrics3 v2.0 specification
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
LyricsHandler(byte[] tagData)
Looks for the Lyrics data, which will be just before the ID3v1 data (if present), and process it.LyricsHandler(InputStream stream, ContentHandler handler)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected static byte[]
getSuffix(InputStream stream, int length)
Reads and returns the lastlength
bytes from the given stream.boolean
hasID3v1()
boolean
hasLyrics()
-
-
-
Constructor Detail
-
LyricsHandler
public LyricsHandler(InputStream stream, ContentHandler handler) throws IOException, SAXException, TikaException
- Throws:
IOException
SAXException
TikaException
-
LyricsHandler
protected LyricsHandler(byte[] tagData) throws IOException, SAXException, TikaException
Looks for the Lyrics data, which will be just before the ID3v1 data (if present), and process it. Also sets things up for the ID3v1 processing if required. Creates from the last 128 bytes of a stream.- Throws:
IOException
SAXException
TikaException
-
-
Method Detail
-
hasID3v1
public boolean hasID3v1()
-
hasLyrics
public boolean hasLyrics()
-
getSuffix
protected static byte[] getSuffix(InputStream stream, int length) throws IOException
Reads and returns the lastlength
bytes from the given stream.- Parameters:
stream
- input streamlength
- number of bytes from the end to read and return- Returns:
- stream the
InputStream
to read from. - Throws:
IOException
- if the stream could not be read from.
-
-