public class ID3v24FrameBodyAudioEncryption extends ID3v24FrameBody
An audio encryption frame body is associated with an ID3v2.4 AENC
frame
which is used to indicate if any part, or all, of the actual audio
stream of the .mp3 file is encrypted, and if so, by whom. The audio encryption frame body contains the following fields:
Field | Description | |
---|---|---|
1. | ownerId | URL containing an e-mail address, or a link to a location where an e-mail address can be found, that belongs to the organization responsible for this specific encrypted audio file. Questions regarding the encrypted audio should be sent to the e-mail address specified. |
2. | previewStart | pointer to an unencrypted part of the audio. If the entire audio part of the .mp3 file is encrypted, then this field should be set to 0. |
3. | previewLength | length of the unencrypted audio data. If the entire audio part of the .mp3 file is encrypted, then this field should be set to 0. |
4. | encryptionInfo | data block required for decryption of the audio. This field is optional, and if no data block is required for decryption, then this field can be left empty (a byte array of length 0). |
There may be more than one audio encryption frame in an ID3v2.4 tag
, but only one with the same ownerId field.
buffer, dirty, frameType
nextNullTerminatorIndex, nullTerminatorIndex
Constructor and Description |
---|
ID3v24FrameBodyAudioEncryption()
The default constructor is called when creating a new frame.
|
ID3v24FrameBodyAudioEncryption(java.io.InputStream inputStream,
int frameBodySize)
This constructor is called when reading in an existing frame from an .mp3 file.
|
ID3v24FrameBodyAudioEncryption(java.lang.String ownerId,
int previewStart,
int previewLength,
byte[] encrcrytpionInfo)
This constructor is called when creating a new frame.
|
Modifier and Type | Method and Description |
---|---|
byte[] |
getEncrcrytpionInfo()
gets the data required for decryption of the audio.
|
java.lang.String |
getOwnerId()
gets the owner id of the frame.
|
int |
getPreviewLength()
gets length of unencrypted audio data.
|
int |
getPreviewStart()
gets a pointer to the unencrypted part of the audio.
|
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 |
setEncrcrytpionInfo(byte[] encrcrytpionInfo)
sets the data required for decryption of the audio.
|
void |
setOwnerId(java.lang.String ownerId)
sets the owner id, which is a URL containing an e-mail address, or a link to a location where an e-mail address can be found, that belongs to the
organization responsible for the frame.
|
void |
setPreviewLength(int previewLength)
sets length of unencrypted audio data.
|
void |
setPreviewStart(int previewStart)
sets a pointer to an unencrypted part of the audio.
|
java.lang.String |
toString()
gets a string representation of the audio encryption 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 ID3v24FrameBodyAudioEncryption()
public ID3v24FrameBodyAudioEncryption(java.lang.String ownerId, int previewStart, int previewLength, byte[] encrcrytpionInfo)
ownerId
- an email address, or a link to a location where an email address can be found, that belongs to the organization responsible for this specific encrypted audio file.previewStart
- a pointer to an unencrypted part of the audio.previewLength
- length of unencrypted data.encrcrytpionInfo
- optional field containing data required for decryption of the audio.public ID3v24FrameBodyAudioEncryption(java.io.InputStream inputStream, int frameBodySize) throws java.io.IOException
inputStream
- input stream pointing to a audio encryption 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 ID3v24FrameBody
java.lang.IllegalArgumentException
- if an invalid value is detected while parsing the frame body's raw bytes.public java.lang.String getOwnerId()
setOwnerId(String)
public void setOwnerId(java.lang.String ownerId)
ownerId
- the id of the owner of the data.getOwnerId()
public int getPreviewStart()
setPreviewStart(int)
public void setPreviewStart(int previewStart)
previewStart
- pointer to an unencrypted part of the audio.getPreviewStart()
public int getPreviewLength()
public void setPreviewLength(int previewLength)
previewLength
- the length of the unencrypted audio data.public byte[] getEncrcrytpionInfo()
public void setEncrcrytpionInfo(byte[] encrcrytpionInfo)
encrcrytpionInfo
- the encrcrytpionInfo.public void setBuffer()
setBuffer
in class ID3v24FrameBody
public java.lang.String toString()
toString
in class java.lang.Object