com.voxbiblia.id3j
Class ID3Serializer

java.lang.Object
  extended by com.voxbiblia.id3j.ID3Serializer

public class ID3Serializer
extends Object

Serializes music file metadata data into a ID3 version 2.3.0 tag byte stream that can be prepended to an MP3 file.


Constructor Summary
ID3Serializer()
           
 
Method Summary
 byte[] serialize(ID3Tag tag)
          Serializes the data in the given tag into the returned byte array.
 byte[] serialize(ID3Tag tag, byte[] previous)
          Copies the frames from the tag previous, replacing any frames which are set in tag.
 byte[] serialize(ID3Tag tag, byte[] previous, boolean compensateCrc)
          Copies the frames from the tag previous, replacing any frames which are set in tag.
 void setPadCount(int padCount)
          Configures this serializer to add padCount null bytes at the end of the tag.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ID3Serializer

public ID3Serializer()
Method Detail

serialize

public byte[] serialize(ID3Tag tag)
Serializes the data in the given tag into the returned byte array.

Parameters:
tag - the tag
Returns:
a byte array with the tags serialized

serialize

public byte[] serialize(ID3Tag tag,
                        byte[] previous)
Copies the frames from the tag previous, replacing any frames which are set in tag.

Parameters:
tag - the data to write to the tag
previous - a previously serialized tag to extract default values from
Returns:
a serialized ID3-tag

serialize

public byte[] serialize(ID3Tag tag,
                        byte[] previous,
                        boolean compensateCrc)
Copies the frames from the tag previous, replacing any frames which are set in tag. If compensateCrc is set to true the resulting tag contains data that makes it's CRC32 checksum match that of a zero-size byte array.

Parameters:
tag - the data to write to the tag
previous - a previously serialized tag to extract default values from
compensateCrc - if set to true the serialized tag is CRC32-neutral.
Returns:
a serialized ID3-tag

setPadCount

public void setPadCount(int padCount)
Configures this serializer to add padCount null bytes at the end of the tag.

Parameters:
padCount - the number of padding bytes to add to written tags