default to trimmed string since most tags include a \0

This commit is contained in:
Brian Matzon 2004-10-28 19:32:31 +00:00
parent bc836b9079
commit 394a3ba97b
1 changed files with 3 additions and 5 deletions

View File

@ -45,9 +45,7 @@ public class FSoundTagField {
/** Name of tagfield */ /** Name of tagfield */
String name; String name;
/** /** ByteBuffer that will point to the tagfield data */
* ByteBuffer that will point to the tagfield data
*/
ByteBuffer value; ByteBuffer value;
/** Length of tagfield data */ /** Length of tagfield data */
@ -112,12 +110,12 @@ public class FSoundTagField {
} }
/** /**
* @value as string * @return value as a <b>trimmed</b> string
*/ */
public String getValueAsString() { public String getValueAsString() {
byte[] buffer = new byte[value.capacity()]; byte[] buffer = new byte[value.capacity()];
value.get(buffer); value.get(buffer);
value.rewind(); value.rewind();
return new String(buffer); return new String(buffer).trim();
} }
} }