private boolean checkHeader(RandomAccessInputStream raf) throws IOException
	{
		raf.seek(HEAD_LOCATION);

		byte[] buf = new byte[HEAD_SIZE];
		if (raf.read(buf) != HEAD_SIZE)
		{
			throw new IOException("Error encountered finding id3v2 header");
		}

		String result = new String(buf, ENC_TYPE);
		if (result.substring(0, TAG_START.length()).equals(TAG_START))
		{
			if ((((int)buf[3]&0xFF) < 0xff) && (((int)buf[4]&0xFF) < 0xff))
			{
				if ((((int)buf[6]&0xFF) < 0x80) && (((int)buf[7]&0xFF) < 0x80) && (((int)buf[8]&0xFF) < 0x80) && (((int)buf[9]&0xFF) < 0x80))
				{
					return true;
				}
			}
		}

		return false;
	}
private boolean checkHeader ( RandomAccessInputStream raf ) throws IOException { raf . seek ( HEAD_LOCATION ) ; byte [ ] buf = new byte [ HEAD_SIZE ] ; if ( raf . read ( buf ) != HEAD_SIZE ) { throw new IOException ( "Error encountered finding id3v2 header" ) ; } String result = new String ( buf , ENC_TYPE ) ; if ( result . substring ( 0 , TAG_START . length ( ) ) . equals ( TAG_START ) ) { if ( ( ( ( int ) buf [ 3 ] & 0xFF ) < 0xff ) && ( ( ( int ) buf [ 4 ] & 0xFF ) < 0xff ) ) { if ( ( ( ( int ) buf [ 6 ] & 0xFF ) < 0x80 ) && ( ( ( int ) buf [ 7 ] & 0xFF ) < 0x80 ) && ( ( ( int ) buf [ 8 ] & 0xFF ) < 0x80 ) && ( ( ( int ) buf [ 9 ] & 0xFF ) < 0x80 ) ) { return true ; } } } return false ; }
Checks to see if there is an id3v2 header in the file provided to the
constructor.

@return true if an id3v2 header exists in the file
@exception FileNotFoundException if an error occurs
@exception IOException if an error occurs