Methods Summary |
---|
private void | checkCommon()This method examines the ID of the current field and modifies
{@link #common}in order to reflect if the tag id is a commonly used one.
this.common = id.equals(TITLE.getFieldName()) || id.equals(ALBUM.getFieldName()) || id.equals(ARTIST.getFieldName())
|| id.equals(GENRE.getFieldName()) || id.equals(TRACKNUMBER.getFieldName()) || id.equals(DATE.getFieldName())
|| id.equals(DESCRIPTION.getFieldName()) || id.equals(COMMENT.getFieldName());
|
protected void | copy(byte[] src, byte[] dst, int dstOffset)This method will copy all bytes of src to dst
at the specified location.
// for (int i = 0; i < src.length; i++)
// dst[i + dstOffset] = src[i];
/*
* Heared that this method is optimized and does its job very near of
* the system.
*/
System.arraycopy(src, 0, dst, dstOffset, src.length);
|
public void | copyContent(org.jaudiotagger.tag.TagField field)
if (field instanceof TagTextField)
{
this.content = ((TagTextField) field).getContent();
}
|
protected byte[] | getBytes(java.lang.String s, java.lang.String encoding)This method will try to return the byte representation of the given
string after it has been converted to the given encoding.
return s.getBytes(encoding);
|
public java.lang.String | getContent()
return content;
|
public java.lang.String | getEncoding()
return VorbisHeader.CHARSET_UTF_8;
|
public java.lang.String | getId()
return this.id;
|
public byte[] | getRawContent()
byte[] size = new byte[VorbisCommentReader.FIELD_COMMENT_LENGTH_LENGTH];
byte[] idBytes = Utils.getDefaultBytes(this.id, "ISO-8859-1");
byte[] contentBytes = getBytes(this.content, "UTF-8");
byte[] b = new byte[4 + idBytes.length + 1 + contentBytes.length];
int length = idBytes.length + 1 + contentBytes.length;
size[3] = (byte) ((length & 0xFF000000) >> 24);
size[2] = (byte) ((length & 0x00FF0000) >> 16);
size[1] = (byte) ((length & 0x0000FF00) >> 8);
size[0] = (byte) (length & 0x000000FF);
int offset = 0;
copy(size, b, offset);
offset += 4;
copy(idBytes, b, offset);
offset += idBytes.length;
b[offset] = (byte) 0x3D;
offset++;// "="
copy(contentBytes, b, offset);
return b;
|
public boolean | isBinary()
return false;
|
public void | isBinary(boolean b)
if (b)
{
// Only throw if binary = true requested.
throw new UnsupportedOperationException("OggTagFields cannot be changed to binary.\n" + "binary data should be stored elsewhere" + " according to Vorbis_I_spec.");
}
|
public boolean | isCommon()
return common;
|
public boolean | isEmpty()
return this.content.equals("");
|
public void | setContent(java.lang.String s)
this.content = s;
|
public void | setEncoding(java.lang.String s)
if (s == null || !s.equalsIgnoreCase("UTF-8"))
{
throw new UnsupportedOperationException("The encoding of OggTagFields cannot be " + "changed.(specified to be UTF-8)");
}
|
public java.lang.String | toString()
return getContent();
|