public class ID3v23FrameBodyOwnership extends ID3v23FrameBody
An ownership frame body is associated with an ID3v2.3 OWNE
frame
which is used to indicate that a user is the owner of the
.mp3 file. This frame is often used in conjunction with the terms of use
and file owner/licensee
frames.
The ownership frame body contains the following fields:
Field | Description | |
---|---|---|
1. | encoding | character set used to encode the seller field. |
2. | prices | the purchase price of the .mp3 file. The purchase price may be specified in equivalent currencies. For
example, USD1.00 = GBP0.60 = EUR1.25, etc. However, there may only be one price for a given currency. That is, you may not specify USD1.00 and USD2.00. |
3. | purchaseDate | date the .mp3 file was purchased formatted as YYYYMMDD. |
4. | seller | the name of the person or organization that sold the .mp3 file. |
There may only be one "OWNE" frame in a tag.
buffer, dirty, frameType
nextNullTerminatorIndex, nullTerminatorIndex
Constructor and Description |
---|
ID3v23FrameBodyOwnership()
The default constructor is called when creating a new frame.
|
ID3v23FrameBodyOwnership(Encoding encoding,
java.util.List<Price> prices,
java.lang.String purchaseDate,
java.lang.String seller)
This constructor is called when creating a new frame.
|
ID3v23FrameBodyOwnership(java.io.InputStream inputStream,
int frameBodySize)
This constructor is called when reading in an existing frame from an .mp3 file.
|
Modifier and Type | Method and Description |
---|---|
Encoding |
getEncoding()
gets the character encoding of the seller.
|
java.util.List<Price> |
getPrices()
gets the price(s) of the .mp3 song.
|
java.lang.String |
getPurchaseDate()
gets the date the mp3 song was purchased.
|
java.lang.String |
getSeller()
sets the vendor who sold the mp3 song.
|
void |
parse()
parses the raw bytes of the frame body and stores the parsed values in the frame's fields.
|
void |
setBuffer()
If the frame body's values have been modified, then resize the raw binary buffer and store the new values there.
|
void |
setEncoding(Encoding encoding)
sets the character encoding of the seller.
|
void |
setPrices(java.util.List<Price> prices)
sets the price(s) of the .mp3 song.
|
void |
setPurchaseDate(java.lang.String purchaseDate)
sets the date the mp3 song was purchased.
|
void |
setSeller(java.lang.String seller)
sets the vendor who sold the mp3 song.
|
java.lang.String |
toString()
gets a string representation of the ownership frame body showing all of the frame's fields and their values.
|
getFrameType, getNextNullTerminator, getSize, isDirty, save, save
getNextNullTerminator, pricesToString, stringToBytes
bytesToInt, bytesToInt, bytesToShort, bytesToShort, bytesToSynchsafeInt, bytesToSynchsafeShort, formateDate, hex, hex, hex, intToBytes, littleEndianBytesToInt, pad, shortToBytes, synchsafeIntToBytes
public ID3v23FrameBodyOwnership()
public ID3v23FrameBodyOwnership(Encoding encoding, java.util.List<Price> prices, java.lang.String purchaseDate, java.lang.String seller)
encoding
- character set used to encode the seller's name.prices
- price(s) paid for the song.purchaseDate
- date the mp3 song was purchased - 8 character date string (YYYYMMDD).seller
- vendor who sold the mp3 song.public ID3v23FrameBodyOwnership(java.io.InputStream inputStream, int frameBodySize) throws java.io.IOException
inputStream
- input stream pointing to an ownership frame body in the .mp3 file.frameBodySize
- size (in bytes) of the frame's body.java.io.IOException
- if there is an error while reading the frame body.public void parse() throws java.lang.IllegalArgumentException
parse
in class ID3v23FrameBody
java.lang.IllegalArgumentException
- if an invalid value is detected while parsing the frame body's raw bytes.public Encoding getEncoding()
setEncoding(Encoding)
public void setEncoding(Encoding encoding)
encoding
- the character set used to encode the seller. Only ISO 8859-1 and UTF-16 are allowed.getEncoding()
public java.util.List<Price> getPrices()
setPrices(List)
public void setPrices(java.util.List<Price> prices)
prices
- price(s) paid for the .mp3 file.getPrices()
public java.lang.String getPurchaseDate()
setPurchaseDate(String)
public void setPurchaseDate(java.lang.String purchaseDate)
purchaseDate
- the purchaseDate in the form YYYYMMDD.java.lang.IllegalArgumentException
- if the date is not valid.getPurchaseDate()
public java.lang.String getSeller()
setSeller(String)
public void setSeller(java.lang.String seller)
seller
- the vendor who sold the mp3 song.getSeller()
public void setBuffer()
setBuffer
in class ID3v23FrameBody
public java.lang.String toString()
toString
in class java.lang.Object