Package com.mpatric.mp3agic
Class EncodedText
java.lang.Object
com.mpatric.mp3agic.EncodedText
public class EncodedText extends Object
-
Field Summary
Fields Modifier and Type Field Description static String
CHARSET_ISO_8859_1
static String
CHARSET_UTF_16
static String
CHARSET_UTF_16BE
static String
CHARSET_UTF_8
static byte
TEXT_ENCODING_ISO_8859_1
static byte
TEXT_ENCODING_UTF_16
static byte
TEXT_ENCODING_UTF_16BE
static byte
TEXT_ENCODING_UTF_8
-
Constructor Summary
Constructors Constructor Description EncodedText(byte[] value)
EncodedText(byte textEncoding, byte[] value)
EncodedText(byte textEncoding, String string)
EncodedText(String string)
EncodedText(String string, byte transcodeToTextEncoding)
-
Method Summary
Modifier and Type Method Description protected static CharBuffer
bytesToCharBuffer(byte[] bytes, String characterSet)
protected static byte[]
charBufferToBytes(CharBuffer charBuffer, String characterSet)
boolean
equals(Object obj)
String
getCharacterSet()
byte[]
getTerminator()
byte
getTextEncoding()
int
hashCode()
void
setTextEncoding(byte textEncoding)
void
setTextEncoding(byte textEncoding, boolean transcode)
byte[]
toBytes()
byte[]
toBytes(boolean includeBom)
byte[]
toBytes(boolean includeBom, boolean includeTerminator)
String
toString()
-
Field Details
-
TEXT_ENCODING_ISO_8859_1
public static final byte TEXT_ENCODING_ISO_8859_1- See Also:
- Constant Field Values
-
TEXT_ENCODING_UTF_16
public static final byte TEXT_ENCODING_UTF_16- See Also:
- Constant Field Values
-
TEXT_ENCODING_UTF_16BE
public static final byte TEXT_ENCODING_UTF_16BE- See Also:
- Constant Field Values
-
TEXT_ENCODING_UTF_8
public static final byte TEXT_ENCODING_UTF_8- See Also:
- Constant Field Values
-
CHARSET_ISO_8859_1
- See Also:
- Constant Field Values
-
CHARSET_UTF_16
- See Also:
- Constant Field Values
-
CHARSET_UTF_16BE
- See Also:
- Constant Field Values
-
CHARSET_UTF_8
- See Also:
- Constant Field Values
-
-
Constructor Details
-
EncodedText
public EncodedText(byte textEncoding, byte[] value) -
EncodedText
- Throws:
IllegalArgumentException
-
EncodedText
public EncodedText(String string, byte transcodeToTextEncoding) throws IllegalArgumentException, CharacterCodingException -
EncodedText
-
EncodedText
public EncodedText(byte[] value)
-
-
Method Details
-
getTextEncoding
public byte getTextEncoding() -
setTextEncoding
- Throws:
CharacterCodingException
-
setTextEncoding
- Throws:
CharacterCodingException
-
getTerminator
public byte[] getTerminator() -
toBytes
public byte[] toBytes() -
toBytes
public byte[] toBytes(boolean includeBom) -
toBytes
public byte[] toBytes(boolean includeBom, boolean includeTerminator) -
toString
-
getCharacterSet
-
hashCode
public int hashCode() -
equals
-
bytesToCharBuffer
protected static CharBuffer bytesToCharBuffer(byte[] bytes, String characterSet) throws CharacterCodingException- Throws:
CharacterCodingException
-
charBufferToBytes
protected static byte[] charBufferToBytes(CharBuffer charBuffer, String characterSet) throws CharacterCodingException- Throws:
CharacterCodingException
-