org.basex.build.fs.parser
Class MP3Parser

java.lang.Object
  extended by org.basex.build.fs.parser.AbstractParser
      extended by org.basex.build.fs.parser.MP3Parser

public final class MP3Parser
extends AbstractParser

Parser for MP3 audio files.

Currently not supported:

Author:
Workgroup DBIS, University of Konstanz 2005-09, ISC License, Alexander Holupirek, Bastian Lemke
See Also:
ID3v2.4.0 structure, ID3v2.4.0 frames

Constructor Summary
MP3Parser()
          Standard constructor.
 
Method Summary
 boolean check(BufferedFileChannel bufFC)
           Checks if there is a File in correct format and can be read by the parser.
static byte[] getGenre(int b)
          Returns the textual representation of the genre with the code b.
 void meta(BufferedFileChannel f, NewFSParser parser)
           Reads the metadata from a BufferedFileChannel and fires events for each key/value pair.
 void readContent(BufferedFileChannel f, NewFSParser parser)
           Reads the textual content from a FileChannel and fires events.
 
Methods inherited from class org.basex.build.fs.parser.AbstractParser
readMeta, readMetaAndContent
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MP3Parser

public MP3Parser()
Standard constructor.

Method Detail

check

public boolean check(BufferedFileChannel bufFC)
              throws java.io.IOException
Description copied from class: AbstractParser

Checks if there is a File in correct format and can be read by the parser. Checks e.g. header bytes.

Specified by:
check in class AbstractParser
Parameters:
bufFC - the BufferedFileChannel to read from.
Returns:
true if the file is supported.
Throws:
java.io.IOException - if an error occurs while reading from the file.

meta

public void meta(BufferedFileChannel f,
                 NewFSParser parser)
          throws java.io.IOException
Description copied from class: AbstractParser

Reads the metadata from a BufferedFileChannel and fires events for each key/value pair.

Parameters:
f - BufferedFileChannel to read from.
parser - the NewFSParser instance to fire events.
Throws:
java.io.IOException - if any error occurs while reading from the file.
See Also:
NewFSParser.metaEvent(Metadata)

readContent

public void readContent(BufferedFileChannel f,
                        NewFSParser parser)
Description copied from class: AbstractParser

Reads the textual content from a FileChannel and fires events.

Specified by:
readContent in class AbstractParser
Parameters:
f - the BufferedFileChannel to read from.
parser - the NewFSParser instance to write the content to.

getGenre

public static byte[] getGenre(int b)
Returns the textual representation of the genre with the code b.

Parameters:
b - the "code" of the genre.
Returns:
the textual representation of the genre.