EMMA Coverage Report (generated Tue Mar 14 21:50:42 EST 2006)
[all classes][org.farng.mp3.id3]

COVERAGE SUMMARY FOR SOURCE FILE [FrameBodyAENC.java]

nameclass, %method, %block, %line, %
FrameBodyAENC.java0%   (0/1)0%   (0/8)0%   (0/85)0%   (0/22)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class FrameBodyAENC0%   (0/1)0%   (0/8)0%   (0/85)0%   (0/22)
FrameBodyAENC (): void 0%   (0/1)0%   (0/3)0%   (0/2)
FrameBodyAENC (FrameBodyAENC): void 0%   (0/1)0%   (0/4)0%   (0/2)
FrameBodyAENC (RandomAccessFile): void 0%   (0/1)0%   (0/6)0%   (0/3)
FrameBodyAENC (String, short, short, byte []): void 0%   (0/1)0%   (0/25)0%   (0/6)
getIdentifier (): String 0%   (0/1)0%   (0/10)0%   (0/1)
getOwner (): String 0%   (0/1)0%   (0/5)0%   (0/1)
getOwner (String): void 0%   (0/1)0%   (0/5)0%   (0/2)
setupObjectList (): void 0%   (0/1)0%   (0/27)0%   (0/5)

1package org.farng.mp3.id3;
2 
3import org.farng.mp3.InvalidTagException;
4import org.farng.mp3.object.ObjectByteArraySizeTerminated;
5import org.farng.mp3.object.ObjectNumberFixedLength;
6import org.farng.mp3.object.ObjectStringNullTerminated;
7 
8import java.io.IOException;
9import java.io.RandomAccessFile;
10 
11/**
12 * <h3>4.19.&nbsp;&nbsp; Audio encryption</h3>
13 * <p/>
14 * <p>&nbsp;&nbsp; This frame indicates if the actual audio stream is encrypted, and by<br>
15 * <p/>
16 * &nbsp;&nbsp; whom. Since standardisation of such encryption scheme is beyond this<br> &nbsp;&nbsp; document, all
17 * &quot;AENC&quot; frames begin with a terminated string with a<br> &nbsp;&nbsp; URL containing an email address, or a
18 * link to a location where an<br> &nbsp;&nbsp; email address can be found, that belongs to the organisation<br>
19 * <p/>
20 * &nbsp;&nbsp; responsible for this specific encrypted audio file. Questions<br> &nbsp;&nbsp; regarding the encrypted
21 * audio should be sent to the email address<br> &nbsp;&nbsp; specified. If a $00 is found directly after the 'Frame
22 * size' and the<br> &nbsp;&nbsp; audio file indeed is encrypted, the whole file may be considered<br> &nbsp;&nbsp;
23 * useless.</p>
24 * <p/>
25 * <p>&nbsp;&nbsp; After the 'Owner identifier', a pointer to an unencrypted part of the<br> &nbsp;&nbsp; audio can be
26 * specified. The 'Preview start' and 'Preview length' is<br> &nbsp;&nbsp; described in frames. If no part is
27 * unencrypted, these fields should<br> &nbsp;&nbsp; be left zeroed. After the 'preview length' field follows optionally
28 * a<br> &nbsp;&nbsp; data block required for decryption of the audio. There may be more<br>
29 * <p/>
30 * &nbsp;&nbsp; than one &quot;AENC&quot; frames in a tag, but only one with the same 'Owner<br> &nbsp;&nbsp;
31 * identifier'.</p>
32 * <p/>
33 * <p>&nbsp;&nbsp;&nbsp;&nbsp; &lt;Header for 'Audio encryption', ID: &quot;AENC&quot;&gt;<br> &nbsp;&nbsp;&nbsp;&nbsp;
34 * Owner identifier&nbsp;&nbsp; &lt;text string&gt; $00<br>
35 * <p/>
36 * &nbsp;&nbsp;&nbsp;&nbsp; Preview start&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $xx xx<br> &nbsp;&nbsp;&nbsp;&nbsp; Preview
37 * length&nbsp;&nbsp;&nbsp;&nbsp; $xx xx<br> &nbsp;&nbsp;&nbsp;&nbsp; Encryption info&nbsp;&nbsp;&nbsp; &lt;binary
38 * data&gt;<br>
39 * <p/>
40 * </p>
41 *
42 * @author Eric Farng
43 * @version $Revision: 1.4 $
44 */
45public class FrameBodyAENC extends AbstractID3v2FrameBody {
46 
47    /**
48     * Creates a new FrameBodyAENC object.
49     */
50    public FrameBodyAENC() {
51        super();
52    }
53 
54    /**
55     * Creates a new FrameBodyAENC object.
56     */
57    public FrameBodyAENC(final FrameBodyAENC body) {
58        super(body);
59    }
60 
61    /**
62     * Creates a new FrameBodyAENC object.
63     */
64    public FrameBodyAENC(final String owner, final short previewStart, final short previewLength, final byte[] data) {
65        super();
66        setObject("Owner", owner);
67        setObject("Preview Start", new Short(previewStart));
68        setObject("Preview Length", new Short(previewLength));
69        setObject("Encryption Info", data);
70    }
71 
72    /**
73     * Creates a new FrameBodyAENC object.
74     */
75    public FrameBodyAENC(final RandomAccessFile file) throws IOException, InvalidTagException {
76        super();
77        read(file);
78    }
79 
80    public String getIdentifier() {
81        return "AENC" + (char) 0 + getOwner();
82    }
83 
84    public String getOwner() {
85        return (String) getObject("Owner");
86    }
87 
88    public void getOwner(final String description) {
89        setObject("Owner", description);
90    }
91 
92    protected void setupObjectList() {
93        appendToObjectList(new ObjectStringNullTerminated("Owner"));
94        appendToObjectList(new ObjectNumberFixedLength("Preview Start", 2));
95        appendToObjectList(new ObjectNumberFixedLength("Preview Length", 2));
96        appendToObjectList(new ObjectByteArraySizeTerminated("Encryption Info"));
97    }
98}

[all classes][org.farng.mp3.id3]
EMMA 2.0.5312 (C) Vladimir Roubtsov