org.jaudiotagger.audio.flac
Class FlacStreamReader

java.lang.Object
  extended by org.jaudiotagger.audio.flac.FlacStreamReader

public class FlacStreamReader
extends java.lang.Object

Flac Stream

Reader files and identifies if this is in fact a flac stream


Field Summary
static java.lang.String FLAC_STREAM_IDENTIFIER
           
static int FLAC_STREAM_IDENTIFIER_LENGTH
           
private  java.io.RandomAccessFile raf
           
private  int startOfFlacInFile
           
 
Constructor Summary
FlacStreamReader(java.io.RandomAccessFile raf)
          Create instance for holding stream info
 
Method Summary
 void findStream()
          Reads the stream block to ensure it is a flac file
 int getStartOfFlacInFile()
          Usually flac header is at start of file, but unofficially and ID3 tag is allowed at the start of the file.
private  boolean isFlacHeader()
           
private  boolean isId3v22Tag()
           
private  boolean isId3v23Tag()
           
private  boolean isId3v24Tag()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

FLAC_STREAM_IDENTIFIER_LENGTH

public static final int FLAC_STREAM_IDENTIFIER_LENGTH
See Also:
Constant Field Values

FLAC_STREAM_IDENTIFIER

public static final java.lang.String FLAC_STREAM_IDENTIFIER
See Also:
Constant Field Values

raf

private java.io.RandomAccessFile raf

startOfFlacInFile

private int startOfFlacInFile
Constructor Detail

FlacStreamReader

public FlacStreamReader(java.io.RandomAccessFile raf)
Create instance for holding stream info

Parameters:
raf -
Method Detail

findStream

public void findStream()
                throws java.io.IOException,
                       CannotReadException
Reads the stream block to ensure it is a flac file

Throws:
java.io.IOException
CannotReadException

isId3v24Tag

private boolean isId3v24Tag()
                     throws java.io.IOException
Throws:
java.io.IOException

isId3v23Tag

private boolean isId3v23Tag()
                     throws java.io.IOException
Throws:
java.io.IOException

isId3v22Tag

private boolean isId3v22Tag()
                     throws java.io.IOException
Throws:
java.io.IOException

isFlacHeader

private boolean isFlacHeader()
                      throws java.io.IOException
Throws:
java.io.IOException

getStartOfFlacInFile

public int getStartOfFlacInFile()
Usually flac header is at start of file, but unofficially and ID3 tag is allowed at the start of the file.

Returns:
the start of the Flac within file