|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.tffenterprises.music.tag.id3v2.Flags
com.tffenterprises.music.tag.id3v2.Flags_3_0
class Flags_3_0
Flags_3_0 implements the flags for version 3.0 of ID3v2 (aka ID3v2.3.0).
Nested Class Summary |
---|
Nested classes/interfaces inherited from class com.tffenterprises.music.tag.id3v2.Flags |
---|
Flags.InputProcessingStream |
Field Summary | |
---|---|
static short |
CRC_EXTFLAG
Extended flag bit for CRC32 presence. |
static byte |
EXTENDED_HEADER_FLAG
Flag bit for extended header presence. |
private short |
extendedFlags
The extended flags field; 16 bits stored in a short. |
private int |
paddingLength
The padding length, a useless value. |
private long |
tagCRC32
A CRC32 value, if necessary |
Fields inherited from class com.tffenterprises.music.tag.id3v2.Flags |
---|
DEFAULT, EXPERIMENTAL_FLAG, UNSYNCHRONIZATION_FLAG |
Constructor Summary | |
---|---|
protected |
Flags_3_0()
Default constructor. |
protected |
Flags_3_0(byte flags)
Constructs a Flags_3_0 object with the given flags and zeroed extended flags. |
protected |
Flags_3_0(byte flags,
short extFlags)
Constructs a Flags_3_0 object with the given flags extended flags. |
Method Summary | |
---|---|
boolean |
checkExtFlagMask(short flagMask)
Check whether a combination of bits is set in the extended flags short. |
void |
checkVersion()
Asserts that the object's assigned version number is compatible. |
boolean |
equals(java.lang.Object other)
Compares this Flags object with another one. |
short |
getExtFlags()
Returns the current state of the extended flags. |
protected java.io.InputStream |
processCRC32ExtFlag(java.io.InputStream is)
|
protected java.io.InputStream |
processExtendedFlags(java.io.InputStream in)
Process the extended header's flags, reading information from the InputStream in, and returning an InputStream suitable for decoding the tag information. |
java.io.InputStream |
processInput(java.io.InputStream in)
Process the InputStream in which the ID3v2 information is embedded. |
java.io.OutputStream |
processOutput(java.io.OutputStream out)
Process the OutputStream in which the ID3v2 tag is to be embedded. |
protected int |
readExtendedHeader(java.io.InputStream in)
Reads the extended header. |
void |
setExtFlagMask(short flagMask)
Set the bits corresponding to a mask of bits. |
void |
setExtFlags(short newFlags)
Set the flags as indicated by the newFlags parameter. |
java.lang.String |
toString()
Returns a String representation of these flags. |
void |
unsetExtFlagMask(short flagMask)
Unset the bits corresponding to a mask of bits. |
void |
updateChecksum(DataOutputChecksum checksum)
Updates a Checksum with all of this object's data. |
boolean |
usesCRC32()
Returns whether these flags indicate the use of a CRC32 |
boolean |
usesExtendedHeader()
v * Returns whether these flags indicate the use of an extended header |
Methods inherited from class com.tffenterprises.music.tag.id3v2.Flags |
---|
check, clone, getChecksum, getFlags, getNewInstance, getNewInstance, getNewInstance, getVersion, hashCode, isChanged, isMarkedExperimental, processUnsynchronization, set, setChanged, setFlags, unset, updateChecksum, usesUnsynchronization |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final short CRC_EXTFLAG
public static final byte EXTENDED_HEADER_FLAG
private short extendedFlags
private transient int paddingLength
private transient long tagCRC32
Constructor Detail |
---|
protected Flags_3_0()
protected Flags_3_0(byte flags)
flags
- the flags used to initialize the object.protected Flags_3_0(byte flags, short extFlags)
flags
- the flags used to initialize the object.extFlags
- the extended flags used to initialize the object.Method Detail |
---|
public void updateChecksum(DataOutputChecksum checksum)
checksum
- the Checksum to be updated.public boolean equals(java.lang.Object other)
equals
in class Flags
other
- The other object.
public java.lang.String toString()
toString
in class Flags
public short getExtFlags()
public void setExtFlags(short newFlags)
newFlags
- the combination of values to assign to the extended flags.public boolean checkExtFlagMask(short flagMask)
flagMask
- the combination of bits to check
public void setExtFlagMask(short flagMask)
flagMask
- the combination of bits to setpublic void unsetExtFlagMask(short flagMask)
flagMask
- the combination of bits to unsetpublic void checkVersion() throws TagDataFormatException
checkVersion
in class Flags
TagDataFormatException
- if the version is not compatible.public boolean usesExtendedHeader()
public boolean usesCRC32()
public java.io.InputStream processInput(java.io.InputStream in) throws java.io.IOException, TagDataFormatException
processInput
in class Flags
in
- the InputStream in which the ID3v2 information is embedded.
InputStream
which will correctly process the tag..
TagDataFormatException
- if the stream contains a malformed tag,
or some erroneous parameters.
java.io.IOException
- if an I/O error occurs.protected int readExtendedHeader(java.io.InputStream in) throws java.io.IOException, TagDataFormatException
in
- the inputstream from which the extended header is to be read.
java.io.IOException
- if an I/O error occurs during reading.
TagDataFormatException
- if the data format is incorrect.protected java.io.InputStream processExtendedFlags(java.io.InputStream in) throws java.io.IOException
In the case of this class, there is in fact nothing to do, since the behaviour of ID3v2.3's extended header is defined in a way that is unusable. We provide an example of how a functional CRC32 might be checked for, but no error is generated.
in
- the inputstream from which to read the data, and that is to
be encapsulated if appropriate.
java.io.IOException
- if an I/O error occurs.protected java.io.InputStream processCRC32ExtFlag(java.io.InputStream is)
public java.io.OutputStream processOutput(java.io.OutputStream out)
ID3v2
when
writing the tag to a file or stream.
This method applies a FilterOutputStream
which
processes any necessary unsynchronization for the tag, and makes
sure the compression flag is not set.
processOutput
in class Flags
out
- the OutputStream to which the ID3v2 tag will be written
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |