[ https://issues.apache.org/jira/browse/TIKA-120?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12630748#action_12630748
]
Jukka Zitting commented on TIKA-120:
------------------------------------
> Should I adopt the approach used in the AutoDetectParser.getPrefix() method?
Something like that would be good, though note that getting the suffix of a stream is a bit
different from getting the prefix. Here's a quick (untested) draft:
private byte[] getSuffix(InputStream stream, int length) throws IOException {
byte[] buffer = new byte[2 * length];
int bytesInBuffer = 0;
int n = stream.read(buffer);
while (n != -1) {
bytesInBuffer += n;
if (bytesInBuffer = buffer.length) {
System.arraycopy(buffer, bytesInBuffer - length, buffer, 0, length);
bytesInBuffer = length;
}
n = stream.read(buffer, bytesInBuffer, buffer.length - bytesInBuffer);
}
if (bytesInBuffer < length) {
length = bytesInBuffer;
}
byte[] result = new byte[length];
System.arraycopy(buffer, bytesInBuffer - length, result, 0, length);
return result;
}
Also, note that unlike in AutoDetectParser you don't need mark support or buffering this parser
class.
> Add support for retrieving ID3 tags from MP3 files
> --------------------------------------------------
>
> Key: TIKA-120
> URL: https://issues.apache.org/jira/browse/TIKA-120
> Project: Tika
> Issue Type: New Feature
> Components: general
> Reporter: Litrik De Roy
> Attachments: testMP3.zip, TIKA-120.diff
>
>
> It would be nice if Tika could retrieve ID3 tags from MP3 files.
> There are a number of libraries that could be used:
> MyID3 (Apache License) http://www.fightingquaker.com/myid3/
> jd3Lib (LGPL) http://sourceforge.net/projects/jd3lib/
> javamusictag (LGPL) http://javamusictag.sourceforge.net/
> jaudiotagger (LGPL) https://jaudiotagger.dev.java.net/
> There might be others (with more Apache-friendly licenses).
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
|