org.apache.tika.parser.mp3
Class ID3v2Frame

java.lang.Object
  extended by org.apache.tika.parser.mp3.ID3v2Frame
All Implemented Interfaces:
MP3Frame

public class ID3v2Frame
extends java.lang.Object
implements MP3Frame

A frame of ID3v2 data, which is then passed to a handler to be turned into useful data.


Nested Class Summary
protected static class ID3v2Frame.RawTag
           
protected  class ID3v2Frame.RawTagIterator
          Iterates over id3v2 raw tags.
 
Method Summary
static MP3Frame createFrameIfPresent(java.io.InputStream inp)
          Returns the next Frame (ID3v2 or Audio) in the file, or null if the next batch of data doesn't correspond to either an ID3v2 Frame or an Audio Frame.
protected static int get7BitsInt(byte[] data, int offset)
          AKA a Synchsafe integer.
 byte[] getData()
           
 byte[] getExtendedHeader()
           
 int getFlags()
           
protected static int getInt(byte[] data)
           
protected static int getInt(byte[] data, int offset)
           
protected static int getInt2(byte[] data, int offset)
           
protected static int getInt3(byte[] data, int offset)
           
 int getLength()
           
 int getMajorVersion()
           
 int getMinorVersion()
           
protected static java.lang.String getString(byte[] data, int offset, int length)
          Returns the String at the given offset and length.
protected static java.lang.String getTagString(byte[] data, int offset, int length)
          Returns the (possibly null padded) String at the given offset and length.
protected static byte[] readFully(java.io.InputStream inp, int length)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getMajorVersion

public int getMajorVersion()

getMinorVersion

public int getMinorVersion()

getFlags

public int getFlags()

getLength

public int getLength()

getExtendedHeader

public byte[] getExtendedHeader()

getData

public byte[] getData()

createFrameIfPresent

public static MP3Frame createFrameIfPresent(java.io.InputStream inp)
                                     throws java.io.IOException
Returns the next Frame (ID3v2 or Audio) in the file, or null if the next batch of data doesn't correspond to either an ID3v2 Frame or an Audio Frame. ID3v2 Frames should come before all Audio ones.

Throws:
java.io.IOException

getInt

protected static int getInt(byte[] data)

getInt

protected static int getInt(byte[] data,
                            int offset)

getInt3

protected static int getInt3(byte[] data,
                             int offset)

getInt2

protected static int getInt2(byte[] data,
                             int offset)

get7BitsInt

protected static int get7BitsInt(byte[] data,
                                 int offset)
AKA a Synchsafe integer. 4 bytes hold a 28 bit number. The highest bit in each byte is always 0 and always ignored.


readFully

protected static byte[] readFully(java.io.InputStream inp,
                                  int length)
                           throws java.io.IOException
Throws:
java.io.IOException

getTagString

protected static java.lang.String getTagString(byte[] data,
                                               int offset,
                                               int length)
Returns the (possibly null padded) String at the given offset and length. String encoding is held in the first byte;


getString

protected static java.lang.String getString(byte[] data,
                                            int offset,
                                            int length)
Returns the String at the given offset and length. Strings are ISO-8859-1



Copyright © 2007-2010 The Apache Software Foundation. All Rights Reserved.