org.mobicents.protocols.smpp.encoding
Class HPRoman8Encoding

java.lang.Object
  extended by org.mobicents.protocols.smpp.encoding.AbstractMessageEncoding<String>
      extended by org.mobicents.protocols.smpp.encoding.AlphabetEncoding
          extended by org.mobicents.protocols.smpp.encoding.HPRoman8Encoding
All Implemented Interfaces:
MessageEncoding<String>

public final class HPRoman8Encoding
extends AlphabetEncoding

Encoding class representing the HP-Roman8 character set.

Version:
$Id: HPRoman8Encoding.java 452 2009-01-15 16:56:36Z orank $

Constructor Summary
HPRoman8Encoding()
           
 
Method Summary
 String decode(byte[] data, int offset, int length)
          Convert SMS message text into a Java String.
 byte[] encode(String s)
          Convert a Java String into SMS message text.
 int getUnknownCharReplacement()
           
 void setUnknownCharReplacement(int unknownCharReplacement)
          Set the byte to use when there is no code point for a Unicode character.
 
Methods inherited from class org.mobicents.protocols.smpp.encoding.AlphabetEncoding
decode, getCharset, getEncodedSize, setCharset
 
Methods inherited from class org.mobicents.protocols.smpp.encoding.AbstractMessageEncoding
getDataCoding
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HPRoman8Encoding

public HPRoman8Encoding()
Method Detail

getUnknownCharReplacement

public int getUnknownCharReplacement()

setUnknownCharReplacement

public void setUnknownCharReplacement(int unknownCharReplacement)
Set the byte to use when there is no code point for a Unicode character. This byte will be inserted into an encoded byte array if the String being encoded contains a character that HPRoman8 has no code point for. The default is to insert the code point for the '?' character - that is, byte 0x3f.

Parameters:
unknownCharReplacement - A code point for one of the characters in the Roman8 character table.
Throws:
IllegalArgumentException - If 0 < unknownCharReplacement < 256 or unknownCharReplacement is 0x1b .

decode

public String decode(byte[] data,
                     int offset,
                     int length)
Description copied from class: AlphabetEncoding
Convert SMS message text into a Java String.

Overrides:
decode in class AlphabetEncoding
Parameters:
data - The bytes to decode.
offset - The offset within the data to begin decoding characters.
length - The number of bytes to decode to characters.

encode

public byte[] encode(String s)
Description copied from class: AlphabetEncoding
Convert a Java String into SMS message text. Implementations of this method must support encoding a null string. In such cases, a byte array of length 0 will be returned.

Specified by:
encode in interface MessageEncoding<String>
Overrides:
encode in class AlphabetEncoding


Copyright © 2011 Mobicents. All Rights Reserved.