mirror of
https://github.com/shadowfacts/lwjgl2-arm64.git
synced 2026-04-05 06:25:46 +00:00
default to trimmed string since most tags include a \0
This commit is contained in:
parent
bc836b9079
commit
394a3ba97b
1 changed files with 3 additions and 5 deletions
|
|
@ -45,9 +45,7 @@ public class FSoundTagField {
|
|||
/** Name of tagfield */
|
||||
String name;
|
||||
|
||||
/**
|
||||
* ByteBuffer that will point to the tagfield data
|
||||
*/
|
||||
/** ByteBuffer that will point to the tagfield data */
|
||||
ByteBuffer value;
|
||||
|
||||
/** 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() {
|
||||
byte[] buffer = new byte[value.capacity()];
|
||||
value.get(buffer);
|
||||
value.rewind();
|
||||
return new String(buffer);
|
||||
return new String(buffer).trim();
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue