com.tffenterprises.music.tag.id3v2
Class Parser

java.lang.Object
  extended by com.tffenterprises.music.tag.id3v2.Parser

public abstract class Parser
extends java.lang.Object

ID3v2Parser is an abstract class that features static methods whose function is to test the parsing of an ID3v2. Usage: ID3v2Parser.Parse(InputStream in);

Version:
1.0d1 $Date: 2002/10/11 00:57:30 $
Author:
Guillaume Lessard, Daniel M. Zimmerman

Field Summary
private static int HEADERLENGTH
          The byte length of an ID3v2 header.
static java.lang.String PREFIX
          The prefix to an ID3v2 tag.
 
Constructor Summary
Parser()
           
 
Method Summary
static void main(java.lang.String[] argv)
          Static entry point to the parser for command-line operation.
static void ParseBytes(byte[] array)
          Parse a byte array, and print out the results to the standard output.
static void ParseStream(java.io.InputStream in)
          Parse an input stream, and print out the results to the standard output.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PREFIX

public static final java.lang.String PREFIX
The prefix to an ID3v2 tag.

See Also:
Constant Field Values

HEADERLENGTH

private static final int HEADERLENGTH
The byte length of an ID3v2 header.

See Also:
Constant Field Values
Constructor Detail

Parser

public Parser()
Method Detail

ParseBytes

public static void ParseBytes(byte[] array)
                       throws java.io.IOException
Parse a byte array, and print out the results to the standard output. This wraps the byte array in a ByteArrayInputStream and passes that to the ID3v2Parser.ParseStream() method. The byte array needs to exclude the first three bytes of the ID3v2 header. This is a requirement in order for the parser to be useable in a situation where the input is a stream on which there is no possibility of going back.

Parameters:
array - the array from which to parse an ID3v2 tag.
Throws:
java.io.IOException - when an I/O error occurs.

ParseStream

public static void ParseStream(java.io.InputStream in)
                        throws java.io.IOException
Parse an input stream, and print out the results to the standard output. The stream needs to be positioned after the first three bytes of the ID3v2 header. This is a requirement in order for the parser to be useable in a situation where the input is a stream on which there is no possibility of going back.

Parameters:
in - the InputStream from whith to parse an ID3v2 tag.
Throws:
java.io.IOException - when an I/O error occurs.

main

public static void main(java.lang.String[] argv)
                 throws java.io.IOException
Static entry point to the parser for command-line operation.

Parameters:
argv - the command-line arguments to the parser.
Throws:
java.io.IOException - if an I/O error occurs during parsing.