Package org.apache.tika.parser.mp3
Class LyricsHandler
java.lang.Object
org.apache.tika.parser.mp3.LyricsHandler
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:
-
Constructor Summary
ModifierConstructorDescriptionprotected
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
Modifier and TypeMethodDescriptionprotected static byte[]
getSuffix
(InputStream stream, int length) Reads and returns the lastlength
bytes from the given stream.boolean
hasID3v1()
boolean
-
Constructor Details
-
LyricsHandler
public LyricsHandler(InputStream stream, ContentHandler handler) throws IOException, SAXException, TikaException - Throws:
IOException
SAXException
TikaException
-
LyricsHandler
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 Details
-
getSuffix
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.
-
hasID3v1
public boolean hasID3v1() -
hasLyrics
public boolean hasLyrics()
-