Coverage Report - org.jaudiotagger.audio.flac.metadatablock.MetadataBlockDataSeekTable
 
Classes in this File Line Coverage Branch Coverage Complexity
MetadataBlockDataSeekTable
83%
5/6
N/A
1
 
 1  
 /*
 2  
  * Entagged Audio Tag library
 3  
  * Copyright (c) 2003-2005 Rapha�l Slinckx <raphael@slinckx.net>
 4  
  * 
 5  
  * This library is free software; you can redistribute it and/or
 6  
  * modify it under the terms of the GNU Lesser General Public
 7  
  * License as published by the Free Software Foundation; either
 8  
  * version 2.1 of the License, or (at your option) any later version.
 9  
  *  
 10  
  * This library is distributed in the hope that it will be useful,
 11  
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
 12  
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 13  
  * Lesser General Public License for more details.
 14  
  * 
 15  
  * You should have received a copy of the GNU Lesser General Public
 16  
  * License along with this library; if not, write to the Free Software
 17  
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 18  
  */
 19  
 package org.jaudiotagger.audio.flac.metadatablock;
 20  
 
 21  
 import java.io.IOException;
 22  
 import java.io.RandomAccessFile;
 23  
 
 24  
 
 25  
 /**
 26  
  * SeekTable Block
 27  
  * <p/>
 28  
  * <p>This is an optional block for storing seek points. It is possible to seek to any given sample in a FLAC stream
 29  
  * without a seek table, but the delay can be unpredictable since the bitrate may vary widely within a stream.
 30  
  * By adding seek points to a stream, this delay can be significantly reduced. Each seek point takes 18 bytes, so 1%
 31  
  * resolution within a stream adds less than 2k. There can be only one SEEKTABLE in a stream, but the table can have
 32  
  * any number of seek points. There is also a special 'placeholder' seekpoint which will be ignored by decoders but
 33  
  * which can be used to reserve space for future seek point insertion.
 34  
  */
 35  
 public class MetadataBlockDataSeekTable implements MetadataBlockData
 36  
 {
 37  
     private byte[] data;
 38  
 
 39  
     public MetadataBlockDataSeekTable(MetadataBlockHeader header, RandomAccessFile raf) throws IOException
 40  10
     {
 41  10
         data = new byte[header.getDataLength()];
 42  10
         raf.readFully(data);
 43  10
     }
 44  
 
 45  
     public byte[] getBytes()
 46  
     {
 47  10
         return data;
 48  
     }
 49  
 
 50  
     public int getLength()
 51  
     {
 52  0
         return data.length;
 53  
     }
 54  
 }