Class ID3v2Frame

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

public class ID3v2Frame extends Object implements MP3Frame
A frame of ID3v2 data, which is then passed to a handler to be turned into useful data.
  • Field Details

  • Method Details

    • setMaxRecordSize

      public static void setMaxRecordSize(int maxRecordSize)
    • createFrameIfPresent

      public static MP3Frame createFrameIfPresent(InputStream inp) throws IOException
      Returns the next ID3v2 Frame in the file, or null if the next batch of data doesn't correspond to either an ID3v2 header. If no ID3v2 frame could be detected and the passed in input stream is a PushbackInputStream, the bytes read so far are pushed back so that they can be read again. ID3v2 Frames should come before all Audio ones.
      Throws:
      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(InputStream inp, int length) throws IOException
      Throws:
      IOException
    • readFully

      protected static byte[] readFully(InputStream inp, int length, boolean shortDataIsFatal) throws IOException
      Throws:
      IOException
    • getTagString

      protected static 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;
    • getComment

      protected static ID3Tags.ID3Comment getComment(byte[] data, int offset, int length)
      Builds up the ID3 comment, by parsing and extracting the comment string parts from the given data.
    • getString

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

      public static int getMaxRecordSize()
    • getMajorVersion

      public int getMajorVersion()
    • getMinorVersion

      public int getMinorVersion()
    • getFlags

      public int getFlags()
    • getLength

      public int getLength()
    • getExtendedHeader

      public byte[] getExtendedHeader()
    • getData

      public byte[] getData()