    All Packages  Class Hierarchy  This Package  Previous  Next  Index

# Class de.vdheide.mp3.ID3v2Header

    java.lang.Object
       |
       +----de.vdheide.mp3.ID3v2Header

public class ID3v2Header
extends Object

##

ID3v2Header()
  Create a new (empty) header
ID3v2Header(byte, byte, boolean, boolean, boolean, int)
  Build a ID3v2 header
ID3v2Header(InputStream)
  Creates an ID3v2 header from an input stream.

##

getBytes()
  Convert header to array of bytes
getExperimental()
  Is experimental?
getTagSize()
  Get length of tag
getUnsynchronization()
  Is unsynchronization bit set?
hasExtendedHeader()
  Is extended header present?
isHeader(byte[])
  Checks if bytes contain a correct header
readFromFile(InputStream)
  Reads header from stream `in` Header must start at file position.
setExperimental(boolean)
  Set / unset experimental e *
setExtendedHeader(boolean)
  Set / unset extended header present
setTagSize(int)
  Set length if tag
setUnsynchronization(boolean)
  Set / unset unsynchronization bit

##

ID3v2Header

     public ID3v2Header()

  Create a new (empty) header

ID3v2Header

     public ID3v2Header(byte version,
                        byte revision,
                        boolean unsynch,
                        boolean extended_header,
                        boolean experimental,
                        int length)

  Build a ID3v2 header

  Parameters:
    version - ID3v2 version
    revision - ID3v2 revision
    unsynch - Use unsynchronization scheme?
    extended_header - Use extended header?
    experimental - Is experimental?
    length - ID3v2 tag length

ID3v2Header

     public ID3v2Header(InputStream in) throws ID3v2IllegalVersionException, NoID3v2HeaderException, IOException

  Creates an ID3v2 header from an input stream.

  Parameters:
    in - Stream to read from
  Throws: ID3v2IllegalVersionException
    If tag has a revision higher than `ID3v2.VERSION`.`ID3v2.REVISION`
  Throws: NoID3v2HeaderException
    If file does not contain an ID3v2 header
  Throws: IOException
    If an I/O error occurs

##

readFromFile

     public void readFromFile(InputStream in) throws ID3v2IllegalVersionException, NoID3v2HeaderException, IOException

  Reads header from stream `in` Header must start at file position.

  Parameters:
    in - Stream to read from
  Throws: ID3v2IllegalVersionException
    If tag has a revision higher than `ID3v2.VERSION`.`ID3v2.REVISION`
  Throws: NoID3v2HeaderException
    If file does not contain an ID3v2 header
  Throws: IOException
    If an I/O error occurs

isHeader

     public static boolean isHeader(byte head[])

  Checks if bytes contain a correct header

  Parameters:
    head - Array of bytes to be checked
  Returns:
    true if header is correct

getUnsynchronization

     public boolean getUnsynchronization()

  Is unsynchronization bit set?

setUnsynchronization

     public void setUnsynchronization(boolean act)

  Set / unset unsynchronization bit

  Parameters:
    act - True: Set unsynchronization bit

hasExtendedHeader

     public boolean hasExtendedHeader()

  Is extended header present?

setExtendedHeader

     public void setExtendedHeader(boolean act)

  Set / unset extended header present

  Parameters:
    act - True: Set extended header present bit

getExperimental

     public boolean getExperimental()

  Is experimental?

setExperimental

     public void setExperimental(boolean act)

  Set / unset experimental e * @param act True: Set experimental bit

getTagSize

     public int getTagSize()

  Get length of tag

  Returns:
    Length of tag without header (complete length - 10)

setTagSize

     public void setTagSize(int size)

  Set length if tag

getBytes

     public byte[] getBytes()

  Convert header to array of bytes

  Returns:
    Header as bytes, ready to write

    All Packages  Class Hierarchy  This Package  Previous  Next  Index