|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.tffenterprises.music.tag.id3v2.frame.FrameHeader
com.tffenterprises.music.tag.id3v2.frame.FrameHeader_3_0
public class FrameHeader_3_0
FrameHeader_3_0 is a class that provides ID3v2 with an interpretation of the frame header structure, as defined in the ID3v2.3 specification.
Field Summary | |
---|---|
static byte |
COMPRESSED_FRAME
Format flags mask that, if set, signifies that the frame's data is compressed using the standard "deflate" algorithm, as implemented by the zlib library. |
static byte |
ENCRYPTED_FRAME
Format flags mask that, if set, signifies that the frame's data has been encrypted. |
static byte |
FILE_ALTER_DISPOSE
Status flags mask that, if set, signifies that the frame is to be discarded or recomputed if the tagged file is altered. |
private byte |
formatFlags
The frame format flags. |
static byte |
GROUPED_FRAME
Format flags mask that, if set, signifies that the frame is part of a group of frames. |
static byte |
READ_ONLY
Status flags mask that, if set, signifies that the frame is read-only, and shouldn't be changed. |
private byte |
statusFlags
The frame status flags. |
static byte |
TAG_ALTER_DISPOSE
Status flags mask that, if set, signifies that the frame is to be discarded or recomputed if the tag is altered. |
Fields inherited from class com.tffenterprises.music.tag.id3v2.frame.FrameHeader |
---|
NULL_ID |
Constructor Summary | |
---|---|
FrameHeader_3_0()
Default constructor. |
|
FrameHeader_3_0(java.io.InputStream in)
Constructs a FrameHeader_2_0 from an InputStream. |
Method Summary | |
---|---|
java.lang.Object |
clone()
Returns a clone of this Flags object. |
boolean |
equals(java.lang.Object other)
Compares this FrameHeader object with another one. |
byte |
getFormatFlags()
Returns this frame's format flags byte. |
byte |
getStatusFlags()
Returns this frame's status flags byte. |
private java.io.OutputStream |
processCompression(java.io.OutputStream out)
This sets up the decompression process for ID3v2.3 frames by layering/substituting a compressing OutputStream
over the one received as a parameter. |
private java.io.InputStream |
processDecompression(java.io.InputStream in)
This sets up the decompression process for ID3v2.3 frames by layering a decompressing InputStream over the
one received as a parameter. |
protected java.io.InputStream |
processInput(java.io.InputStream in)
Layer input stream filters over in in accordance
with the frame flags, and return the resulting input stream. |
protected java.io.OutputStream |
processOutput(java.io.OutputStream out)
Process the OutputStream in which the frame is to be embedded. |
void |
setFormatFlags(byte flags)
Sets this frame's format flags byte. |
void |
setStatusFlags(byte flags)
Sets this frame's status flags byte. |
java.lang.String |
toString()
Returns a String representation of this
FrameHeader object. |
void |
updateChecksum(DataOutputChecksum checksum)
Updates a Checskum with all this object's data. |
boolean |
usesCompression()
Returns whether this frame uses compression |
void |
writeTo(java.io.OutputStream os)
Writes this FrameHeader to an
OutputStream . |
Methods inherited from class com.tffenterprises.music.tag.id3v2.frame.FrameHeader |
---|
checkFormatMask, checkStatusMask, getChecksum, getDataLength, getFrameBytesFromStream, getFrameID, getFrameLength, getNewInstance, getNewInstance, getNewInstance, getNewInstance, hashCode, isChanged, isValidFrameID, setChanged, setDataLength, setFormatMask, setFrameID, setFrameLength, setStatusMask, unsetFormatMask, unsetStatusMask, usesDataLengthIndicator, usesEncryption, usesGroupID, usesUnsynchronization |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final byte TAG_ALTER_DISPOSE
public static final byte FILE_ALTER_DISPOSE
public static final byte READ_ONLY
public static final byte COMPRESSED_FRAME
public static final byte ENCRYPTED_FRAME
public static final byte GROUPED_FRAME
private byte statusFlags
private byte formatFlags
Constructor Detail |
---|
public FrameHeader_3_0()
This constructor should not be called by normal users of FrameHeader objects. Use the factory method getNewInstance(short version) instead.
public FrameHeader_3_0(java.io.InputStream in) throws java.io.IOException, PaddingException, TagDataFormatException
in
- An InputStream from which to read the FrameHeader information.
PaddingException
- if all the read bytes are nulls
java.io.IOException
- if the InputStream throws one
TagDataFormatException
Method Detail |
---|
public void updateChecksum(DataOutputChecksum checksum)
updateChecksum
in class FrameHeader
checksum
- a Checksum to be updated.public java.lang.Object clone()
clone
in class FrameHeader
public boolean equals(java.lang.Object other)
equals
in class FrameHeader
other
- The other object.
public java.lang.String toString()
String
representation of this
FrameHeader
object.
toString
in class FrameHeader
String
representation of this
FrameHeader
object.public byte getStatusFlags()
getStatusFlags
in class FrameHeader
public void setStatusFlags(byte flags)
setStatusFlags
in class FrameHeader
flags
- The new status flags byte.public byte getFormatFlags()
getFormatFlags
in class FrameHeader
public void setFormatFlags(byte flags)
setFormatFlags
in class FrameHeader
flags
- The new format flags byte.public boolean usesCompression()
usesCompression
in class FrameHeader
public void writeTo(java.io.OutputStream os) throws java.io.IOException
FrameHeader
to an
OutputStream
. This method is used by Frame
subclasses during the
execution of their writeTo(OutputStream)
and
getBytes()
methods. The state of the object
should be assumed to have preliminarily been updated with data
and values obtained from the writeTo in class FrameHeader
os
- the stream to which this object will be written.
java.io.IOException
- if an I/O error occurs while writing.protected java.io.InputStream processInput(java.io.InputStream in) throws FrameDataFormatException
in
in accordance
with the frame flags, and return the resulting input stream. This
is called from within getFrameBytesFromStream()
.
processInput
in class FrameHeader
in
- the initial input stream.
FrameDataFormatException
- if the frame cannot be decoded
for any reason (most likely
due to incorrect data formatting).private java.io.InputStream processDecompression(java.io.InputStream in) throws java.io.IOException
InputStream
over the
one received as a parameter.
in
- an input stream from which the frame is being read.
java.io.IOException
- if an I/O error occurs while reading.protected java.io.OutputStream processOutput(java.io.OutputStream out) throws java.io.IOException
Frame
subclasses
when the frame is being written to a file or stream
A FrameHeader
subclass should override this method and apply
whatever calculations and FilterOutputStream
subclasses
are necessary to output a correct stream of the frame. See the method
postProcessUnsynchronization()
of Flags
for an example of a FilterOutputStream
that can be
applied through this method.
processOutput
in class FrameHeader
out
- the OutputStream to which the frame will be written
java.io.IOException
- if an error occursprivate java.io.OutputStream processCompression(java.io.OutputStream out)
OutputStream
over the one received as a parameter.
out
- an input stream to which the frame will be written.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |