com.dusbabek.lib.id3
Class TagHeader_v2_3

java.lang.Object
  extended by com.dusbabek.lib.id3.BasicTagHeader
      extended by com.dusbabek.lib.id3.TagHeader_v2_2
          extended by com.dusbabek.lib.id3.TagHeader_v2_3
All Implemented Interfaces:
TagHeader
Direct Known Subclasses:
TagHeader_v2_4

public class TagHeader_v2_3
extends TagHeader_v2_2

ID3v2.3 header. They only get more complicated.


Field Summary
 
Fields inherited from class com.dusbabek.lib.id3.BasicTagHeader
BASIC_TAG_HEADER_LEN
 
Constructor Summary
TagHeader_v2_3()
          constructs an empty header
TagHeader_v2_3(byte[] data, java.io.InputStream in)
          construct a header from 10 bytes and an input stream.
 
Method Summary
 long getDataSize()
          returns the size of the data (not including ANY headers).
protected  ExtendedTagHeader makeExtendedHeader(java.io.InputStream in)
          create an extended header.
 void setDataSize(long l)
          set the size of the data.
 int sizeOf()
          kind of moot.
 boolean usesExperimental()
           
 boolean usesExtendedHeader()
           
 void write(java.io.OutputStream out)
          write this header to a stream.
 
Methods inherited from class com.dusbabek.lib.id3.TagHeader_v2_2
usesCompression, usesUnsynchronization
 
Methods inherited from class com.dusbabek.lib.id3.BasicTagHeader
getFlags, getTagSize, getVersion, setTagSize
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TagHeader_v2_3

public TagHeader_v2_3()
               throws java.io.IOException
constructs an empty header

Throws:
java.io.IOException

TagHeader_v2_3

public TagHeader_v2_3(byte[] data,
                      java.io.InputStream in)
               throws java.io.IOException
construct a header from 10 bytes and an input stream.

Parameters:
data - byte[] a basic header.
in - InputStream
Throws:
java.io.IOException
Method Detail

makeExtendedHeader

protected ExtendedTagHeader makeExtendedHeader(java.io.InputStream in)
                                        throws java.io.IOException
create an extended header. Extended header formats differ across versions so the implementation of creating them needs to be specific to the header implementations.

Parameters:
in - InputStream
Returns:
ExtendedTagHeader
Throws:
java.io.IOException

usesExtendedHeader

public boolean usesExtendedHeader()
Returns:
true if an extended header is present

usesExperimental

public boolean usesExperimental()
Returns:
true if this tag is experimental.

sizeOf

public int sizeOf()
kind of moot. returns the actual size of the header, which will include an extended header in some versions.

Specified by:
sizeOf in interface TagHeader
Overrides:
sizeOf in class BasicTagHeader
Returns:
int

getDataSize

public long getDataSize()
returns the size of the data (not including ANY headers).

Specified by:
getDataSize in interface TagHeader
Overrides:
getDataSize in class BasicTagHeader
Returns:
long

setDataSize

public void setDataSize(long l)
set the size of the data.

Specified by:
setDataSize in interface TagHeader
Overrides:
setDataSize in class BasicTagHeader
Parameters:
l - long

write

public void write(java.io.OutputStream out)
           throws java.io.IOException
write this header to a stream. Note that the tag size needs to be correct BEFORE the write. All Tag implementations need to be aware of this.

Specified by:
write in interface TagHeader
Overrides:
write in class BasicTagHeader
Parameters:
out - OutputStream
Throws:
java.io.IOException


Copyright © 2004, 2005 Gary Dusbabek. All Rights Reserved.