net.kano.joscar
Class ImEncodedString

java.lang.Object
  extended bynet.kano.joscar.ImEncodedString

public final class ImEncodedString
extends java.lang.Object

A class representing a string encoded using "IM encoding," or the method of unicode encoding used when sending instant messages.

See Also:
ImEncodingParams

Method Summary
static ImEncodedString encodeString(java.lang.String string)
          Returns an object representing the given string encoded with IM encoding as well as the encoding parameters used.
 byte[] getBytes()
          Returns the raw bytes of the encoded string.
 ImEncodingParams getEncoding()
          Returns the IM encoding parameters used to encode the associated string.
 java.lang.String getString()
          Returns the string represented by this object.
static java.lang.String readImEncodedString(ImEncodingParams encoding, ByteBlock block)
          Creates a new String from the given block of binary data and the given encoding.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

readImEncodedString

public static java.lang.String readImEncodedString(ImEncodingParams encoding,
                                                   ByteBlock block)
Creates a new String from the given block of binary data and the given encoding.

Parameters:
encoding - an object representing the IM encoding parameters to be used in decoding the given block of data into a string
block - a block of data containing a string encoded with the given IM encoding parameters
Returns:
a String decoded from the given block with the given encoding

encodeString

public static ImEncodedString encodeString(java.lang.String string)
Returns an object representing the given string encoded with IM encoding as well as the encoding parameters used.

Parameters:
string - the string to encode
Returns:
an object containing the IM encoding parameters used to encode the given string as well as the encoded string itself

getEncoding

public final ImEncodingParams getEncoding()
Returns the IM encoding parameters used to encode the associated string.

Returns:
the IM encoding parameters used to encode this string

getBytes

public final byte[] getBytes()
Returns the raw bytes of the encoded string.

Returns:
the raw bytes of the associated string

getString

public final java.lang.String getString()
Returns the string represented by this object.

Returns:
this object's associated string