com.tffenterprises.music.tag.id3v2
Class SynchSafeInteger
java.lang.Object
com.tffenterprises.music.tag.id3v2.SynchSafeInteger
public class SynchSafeInteger
- extends java.lang.Object
SynchSafeInteger provides conversion methods between "normal" integers
and "synch-safe integers", ID3v2's 28-bit encoding of integer values
that is guaranteed to not trigger MPEG-audio decoders.
- Version:
- 1.0d1 $Date: 2002/08/08 16:14:01 $
- Author:
- Guillaume Lessard
Method Summary |
static int |
Decode(int encoded)
Decode a "synch-safe integer" to a normal int . |
static int |
Encode(int integer)
Encode an integer value to an ID3v2 "synch-safe integer". |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SynchSafeInteger
public SynchSafeInteger()
Decode
public static int Decode(int encoded)
throws java.lang.IllegalArgumentException
- Decode a "synch-safe integer" to a normal
int
.
- Parameters:
encoded
- the four-byte value found in an ID3v2 synch-safe integer.
- Returns:
- the
int
value decoded from the synch-safe integer.
- Throws:
java.lang.IllegalArgumentException
- if encoded
is malformed.
Encode
public static int Encode(int integer)
throws java.lang.IllegalArgumentException
- Encode an integer value to an ID3v2 "synch-safe integer".
- Parameters:
integer
- an integer value to be converted to "synch-safe".
- Returns:
- the synch-safe encoding of the input integer value.
- Throws:
java.lang.IllegalArgumentException
- if integer
cannot
be represented in 28 bits.