Methods Summary |
---|
public boolean | canFail(){@inheritDoc}
return false;
|
public org.jaudiotagger.audio.asf.data.GUID[] | getApplyingIds(){@inheritDoc}
return APPLYING.clone();
|
private int[] | getStringSizes(java.io.InputStream stream)Returns the next 5 UINT16 values as an array.
final int[] result = new int[5];
for (int i = 0; i < result.length; i++) {
result[i] = Utils.readUINT16(stream);
}
return result;
|
public org.jaudiotagger.audio.asf.data.Chunk | read(org.jaudiotagger.audio.asf.data.GUID guid, java.io.InputStream stream, long chunkStart){@inheritDoc}
final BigInteger chunkSize = Utils.readBig64(stream);
/*
* Now comes 16-Bit values representing the length of the Strings which
* follows.
*/
final int[] stringSizes = getStringSizes(stream);
/*
* Now we know the String length of each occuring String.
*/
final String[] strings = new String[stringSizes.length];
for (int i = 0; i < strings.length; i++) {
if (stringSizes[i] > 0) {
strings[i] = Utils
.readFixedSizeUTF16Str(stream, stringSizes[i]);
}
}
/*
* Now create the result
*/
final ContentDescription result = new ContentDescription(chunkStart,
chunkSize);
if (stringSizes[0] > 0) {
result.setTitle(strings[0]);
}
if (stringSizes[1] > 0) {
result.setAuthor(strings[1]);
}
if (stringSizes[2] > 0) {
result.setCopyright(strings[2]);
}
if (stringSizes[3] > 0) {
result.setComment(strings[3]);
}
if (stringSizes[4] > 0) {
result.setRating(strings[4]);
}
return result;
|