Logo Search packages:      
Sourcecode: libjlayer-java version File versions  Download package

int javazoom::jl::decoder::Bitstream::readID3v2Header ( InputStream  in  )  throws IOException [inline, private]

Parse ID3v2 tag header to find out size of ID3v2 frames.

Parameters:
in MP3 InputStream
Returns:
size of ID3v2 frames + header
Exceptions:
IOException 
Author:
JavaZOOM

Definition at line 212 of file Bitstream.java.

Referenced by loadID3v2().

      {           
            byte[] id3header = new byte[4];
            int size = -10;
            in.read(id3header,0,3);
            // Look for ID3v2
            if ( (id3header[0]=='I') && (id3header[1]=='D') && (id3header[2]=='3'))
            {
                  in.read(id3header,0,3);
                  int majorVersion = id3header[0];
                  int revision = id3header[1];
                  in.read(id3header,0,4);
                  size = (int) (id3header[0] << 21) + (id3header[1] << 14) + (id3header[2] << 7) + (id3header[3]);
            }
            return (size+10);
      }


Generated by  Doxygen 1.6.0   Back to index