org.basex.build.fs.parser
Class JPGParser

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

public final class JPGParser
extends AbstractParser

Parser for JPG files.

Author:
Workgroup DBIS, University of Konstanz 2005-09, ISC License, Christian Gruen, Bastian Lemke

Constructor Summary
JPGParser()
          Standard constructor.
 
Method Summary
 boolean check(BufferedFileChannel f)
           Checks if there is a File in correct format and can be read by the parser.
 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

JPGParser

public JPGParser()
Standard constructor.

Method Detail

check

public boolean check(BufferedFileChannel f)
              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:
f - 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.

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.

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)