Coverage Report - org.jaudiotagger.audio.ogg.util.VorbisSetupHeader
 
Classes in this File Line Coverage Branch Coverage Complexity
VorbisSetupHeader
0%
0/12
0%
0/4
1.667
 
 1  
 package org.jaudiotagger.audio.ogg.util;
 2  
 
 3  
 import org.jaudiotagger.audio.generic.Utils;
 4  
 
 5  
 import java.util.logging.Logger;
 6  
 
 7  
 /**
 8  
  * Vorbis Setup header
 9  
  * <p/>
 10  
  * We dont need to decode a vorbis setup header for metatagging, but we should be able to identify
 11  
  * it.
 12  
  *
 13  
  * @author Paul Taylor
 14  
  * @version 12th August 2007
 15  
  */
 16  
 public class VorbisSetupHeader implements VorbisHeader
 17  
 {
 18  
     // Logger Object
 19  0
     public static Logger logger = Logger.getLogger("org.jaudiotagger.audio.ogg.atom");
 20  
 
 21  0
     private boolean isValid = false;
 22  
 
 23  
     public VorbisSetupHeader(byte[] vorbisData)
 24  0
     {
 25  0
         decodeHeader(vorbisData);
 26  0
     }
 27  
 
 28  
     public boolean isValid()
 29  
     {
 30  0
         return isValid;
 31  
     }
 32  
 
 33  
     public void decodeHeader(byte[] b)
 34  
     {
 35  0
         int packetType = b[FIELD_PACKET_TYPE_POS];
 36  0
         logger.fine("packetType" + packetType);
 37  0
         String vorbis = Utils.getString(b, FIELD_CAPTURE_PATTERN_POS, FIELD_CAPTURE_PATTERN_LENGTH, "ISO-8859-1");
 38  0
         if (packetType == VorbisPacketType.SETUP_HEADER.getType() && vorbis.equals(CAPTURE_PATTERN))
 39  
         {
 40  0
             isValid = true;
 41  
         }
 42  0
     }
 43  
 
 44  
 }