com.dusbabek.lib.id3
Class FrameHeader_v2_3

java.lang.Object
  extended by com.dusbabek.lib.id3.FrameHeader_v2_3
All Implemented Interfaces:
FrameHeader
Direct Known Subclasses:
FrameHeader_v2_4

public class FrameHeader_v2_3
extends java.lang.Object
implements FrameHeader

Frame header for ID3v2.3


Field Summary
static int FRAME_HEADER_LEN
          basic header is always 10 bytes.
 
Constructor Summary
FrameHeader_v2_3(byte[] data)
          construct a header from raw data.
FrameHeader_v2_3(java.lang.String id)
          construct an empty header using a specific frame id.
 
Method Summary
 boolean compressed()
          
 boolean encrypted()
          I must point out that the spec is only half-baked in this regard.
 boolean fileAlterPreservation()
           
protected  byte[] getFlags()
           
 byte getGrouping()
           
 java.lang.String getId()
          
 int getSize()
          
 long getUncompressedSize()
          
 boolean grouping()
           
 boolean readOnly()
           
 void setFrameSize(int size)
          set the frame data size
 void setGrouping(byte b)
          set the grouping type
 void setUncompressedSize(long l)
          set the uncompressed size of this frame.
 int sizeOf()
          
 boolean tagAlterPreservation()
           
 void write(java.io.OutputStream out)
          write header to a stream
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

FRAME_HEADER_LEN

public static final int FRAME_HEADER_LEN
basic header is always 10 bytes.

See Also:
Constant Field Values
Constructor Detail

FrameHeader_v2_3

public FrameHeader_v2_3(java.lang.String id)
                 throws java.io.IOException
construct an empty header using a specific frame id.

Throws:
java.io.IOException

FrameHeader_v2_3

public FrameHeader_v2_3(byte[] data)
                 throws java.io.IOException
construct a header from raw data.

Throws:
java.io.IOException
Method Detail

getFlags

protected byte[] getFlags()
Returns:
flags

getId

public java.lang.String getId()

Specified by:
getId in interface FrameHeader
Returns:
the frame id

getSize

public int getSize()

Specified by:
getSize in interface FrameHeader
Returns:
the size of frame data

sizeOf

public int sizeOf()

Specified by:
sizeOf in interface FrameHeader
Returns:
the size of the frame header (includes extended headers)

setFrameSize

public void setFrameSize(int size)
set the frame data size

Specified by:
setFrameSize in interface FrameHeader

write

public void write(java.io.OutputStream out)
           throws java.io.IOException
write header to a stream

Specified by:
write in interface FrameHeader
Throws:
java.io.IOException

tagAlterPreservation

public boolean tagAlterPreservation()
Returns:
tag alter preservation

fileAlterPreservation

public boolean fileAlterPreservation()
Returns:
file alter preservation

readOnly

public boolean readOnly()
Returns:
true if this frame is meant to be read only.

compressed

public boolean compressed()

Specified by:
compressed in interface FrameHeader
Returns:
true if frame is compressed

encrypted

public boolean encrypted()
I must point out that the spec is only half-baked in this regard. THE BEST I can do is ignore encrypted frames.

Returns:
true if this frame is encrypted.

grouping

public boolean grouping()
Returns:
true if this frame uses grouping.

setUncompressedSize

public void setUncompressedSize(long l)
set the uncompressed size of this frame.


getUncompressedSize

public long getUncompressedSize()

Specified by:
getUncompressedSize in interface FrameHeader
Returns:
the uncompressed size of the frame data

setGrouping

public void setGrouping(byte b)
set the grouping type


getGrouping

public byte getGrouping()
Returns:
the grouping type.


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