|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jaudiotagger.audio.flac.metadatablock.MetadataBlockDataPicture
public class MetadataBlockDataPicture
Picture Block
This block is for storing pictures associated with the file, most commonly cover art from CDs. There may be more than one PICTURE block in a file. The picture format is similar to the APIC frame in ID3v2. The PICTURE block has a type, MIME type, and UTF-8 description like ID3v2, and supports external linking via URL (though this is discouraged). The differences are that there is no uniqueness constraint on the description field, and the MIME type is mandatory. The FLAC PICTURE block also includes the resolution, color depth, and palette size so that the client can search for a suitable picture without having to scan them all
Format:
Field Summary | |
---|---|
private int |
colourDepth
|
private java.lang.String |
description
|
private int |
height
|
static java.lang.String |
IMAGE_IS_URL
|
private byte[] |
imageData
|
private int |
indexedColouredCount
|
static java.util.logging.Logger |
logger
|
private java.lang.String |
mimeType
|
private int |
pictureType
|
private int |
width
|
Constructor Summary | |
---|---|
MetadataBlockDataPicture(byte[] imageData,
int pictureType,
java.lang.String mimeType,
java.lang.String description,
int width,
int height,
int colourDepth,
int indexedColouredCount)
Construct new MetadataPicture block |
|
MetadataBlockDataPicture(MetadataBlockHeader header,
java.io.RandomAccessFile raf)
Construct picture block by reading from file |
Method Summary | |
---|---|
void |
copyContent(TagField field)
This method copies the data of the given field to the current data. |
byte[] |
getBytes()
|
int |
getColourDepth()
|
java.lang.String |
getDescription()
|
int |
getHeight()
|
java.lang.String |
getId()
Returns the Id of the represented tag field. This value should uniquely identify a kind of tag data, like title. |
byte[] |
getImageData()
|
java.lang.String |
getImageUrl()
|
int |
getIndexedColourCount()
|
int |
getLength()
|
java.lang.String |
getMimeType()
|
int |
getPictureType()
|
byte[] |
getRawContent()
This method delivers the binary representation of the fields data in order to be directly written to the file. |
private java.lang.String |
getString(java.nio.ByteBuffer rawdata,
int length,
java.lang.String charset)
|
int |
getWidth()
|
boolean |
isBinary()
Determines whether the represented field contains (is made up of) binary data, instead of text data. Software can identify fields to be displayed because they are human readable if this method returns false . |
void |
isBinary(boolean b)
Deprecated. As for now is of no use. Implementations should use another way of setting this property. |
boolean |
isCommon()
Identifies a field to be of common use. Some software may differ between common and not common fields. |
boolean |
isEmpty()
Determines whether the content of the field is empty. |
boolean |
isImageUrl()
|
java.lang.String |
toString()
This method returns a human readable description of the fields contents. For text fields it should be the text itself. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String IMAGE_IS_URL
private int pictureType
private java.lang.String mimeType
private java.lang.String description
private int width
private int height
private int colourDepth
private int indexedColouredCount
private byte[] imageData
public static java.util.logging.Logger logger
Constructor Detail |
---|
public MetadataBlockDataPicture(MetadataBlockHeader header, java.io.RandomAccessFile raf) throws java.io.IOException, InvalidFrameException
header
- raf
-
java.io.IOException
InvalidFrameException
public MetadataBlockDataPicture(byte[] imageData, int pictureType, java.lang.String mimeType, java.lang.String description, int width, int height, int colourDepth, int indexedColouredCount)
imageData
- pictureType
- mimeType
- description
- width
- height
- colourDepth
- indexedColouredCount
- Method Detail |
---|
private java.lang.String getString(java.nio.ByteBuffer rawdata, int length, java.lang.String charset) throws java.io.IOException
java.io.IOException
public byte[] getBytes()
getBytes
in interface MetadataBlockData
public int getLength()
getLength
in interface MetadataBlockData
public int getPictureType()
public java.lang.String getMimeType()
public java.lang.String getDescription()
public int getWidth()
public int getHeight()
public int getColourDepth()
public int getIndexedColourCount()
public byte[] getImageData()
public boolean isImageUrl()
public java.lang.String getImageUrl()
public java.lang.String toString()
TagField
toString
in interface TagField
toString
in class java.lang.Object
public void copyContent(TagField field)
copyContent
in interface TagField
field
- The field containing the data to be taken.public java.lang.String getId()
AbstractTag
will use the "id" to summarize multiple
fields.
getId
in interface TagField
public byte[] getRawContent() throws java.io.UnsupportedEncodingException
getRawContent
in interface TagField
java.io.UnsupportedEncodingException
- Most tag data represents text. In some cases the underlying
implementation will need to convert the text data in java to
a specific charset encoding. In these cases an
UnsupportedEncodingException
may occur.public boolean isBinary()
false
.
isBinary
in interface TagField
true
if field represents binary data (not human
readable).public void isBinary(boolean b)
isBinary
in interface TagField
b
- true
, if the field contains binary data.public boolean isCommon()
isCommon
in interface TagField
true
if the field is of common use.public boolean isEmpty()
isEmpty
in interface TagField
true
if no data is stored (or empty String).
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |