public class CodeSet extends Object
Modifier and Type | Class and Description |
---|---|
static interface |
CodeSet.InputBuffer
This interface represents a buffer from which character data can be read.
|
static interface |
CodeSet.OutputBuffer
Represents a buffer to which character data may be written.
|
Modifier and Type | Method and Description |
---|---|
static void |
configure(Configuration config)
configure configures the logger and codesets. |
static ServiceContext |
createCodesetContext(CodeSet tcs,
CodeSet tcsw) |
static String |
csName(int cs) |
int |
get_wstring_size(String string,
int startPos,
int currentPos)
Returns the length of the string just written to the buffer.
|
static CodeSet |
getCodeSet(int id)
Returns the code set which matches the specified ID.
|
static CodeSet |
getCodeSet(String name)
Returns the code set which matches the specified name, which should either be the canonical name of
a supported encoding or the hex representation of its ID.
|
static CodeSetContext |
getCodeSetContext(ServiceContext[] contexts) |
static CodeSet |
getCodeSetIfMatched(int localCodeSetId,
CodeSetComponent remote) |
int |
getId()
Returns the CORBA-standard id for this code set.
|
static CodeSetComponentInfo |
getLocalCodeSetComponentInfo() |
static CodeSet |
getMatchingCodeSet(CodeSetComponent local,
CodeSetComponent remote,
boolean wide) |
String |
getName()
Returns the canonical name of this code set.
|
static CodeSet |
getNegotiatedCodeSet(CodeSetComponentInfo serverCodeSetInfo,
boolean wide) |
static CodeSet |
getTCSDefault() |
static CodeSet |
getTCSWDefault() |
static void |
main(String[] args) |
char |
read_wchar(CodeSet.InputBuffer buffer,
int giop_minor,
boolean littleEndian)
Reads a wide character from the specified buffer.
|
String |
read_wstring(CodeSet.InputBuffer buffer,
int lengthIndicator,
int giop_minor,
boolean littleEndian)
Reads a wide string from the buffer.
|
protected String |
readGiop12WString(CodeSet.InputBuffer buffer,
int size,
int giop_minor)
Reads a wide string from the buffer according to GIOP 1.2.
|
boolean |
supportsCharacterData(boolean wide)
Returns true if this codeset supports the specified character type.
|
boolean |
supportsWideCharacterData()
Returns true if this codeset supports multie-byte characters
|
boolean |
write_bom(boolean configuredForBom)
Returns true if this code set requires byte-order-markers to be written to the beginning of a stream of text.
|
void |
write_char(CodeSet.OutputBuffer buffer,
char c,
boolean write_bom,
boolean write_length,
int giop_minor)
Writes a character to the buffer with the appropriate encoding.
|
public CodeSet(int id, String name)
public static String csName(int cs)
public static void configure(Configuration config) throws ConfigurationException
configure
configures the logger and codesets. It is
synchronized as the configuration parameters are static and therefore
we do not want to 'collide' with another init.
This class does not implement configurable which ideally it should. However
as this method is static it would conflict with it.config
- a Configuration
valueConfigurationException
- if an error occurspublic static CodeSet getCodeSet(String name)
name
- the string used to select a codeset.public static CodeSet getCodeSet(int id)
public static CodeSet getTCSDefault()
public static CodeSet getTCSWDefault()
public static ServiceContext createCodesetContext(CodeSet tcs, CodeSet tcsw)
public static CodeSetContext getCodeSetContext(ServiceContext[] contexts)
public static CodeSetComponentInfo getLocalCodeSetComponentInfo()
public static CodeSet getNegotiatedCodeSet(CodeSetComponentInfo serverCodeSetInfo, boolean wide)
public static CodeSet getMatchingCodeSet(CodeSetComponent local, CodeSetComponent remote, boolean wide)
public static CodeSet getCodeSetIfMatched(int localCodeSetId, CodeSetComponent remote)
public boolean supportsCharacterData(boolean wide)
wide
- public boolean supportsWideCharacterData()
public int getId()
public String getName()
public boolean write_bom(boolean configuredForBom)
configuredForBom
- true if the orb has been configured to write byte-order-markers.public char read_wchar(CodeSet.InputBuffer buffer, int giop_minor, boolean littleEndian)
buffer
- the buffer containing the data.giop_minor
- the low-order byte of the giop version (1.x is assumed)littleEndian
- true if the character is to be read low end firstpublic String read_wstring(CodeSet.InputBuffer buffer, int lengthIndicator, int giop_minor, boolean littleEndian)
buffer
- the buffer from which to read the stringlengthIndicator
- the length indicator already readgiop_minor
- the low-order byte of the giop version (1.x is assumed)littleEndian
- true if the characters are to be read low end firstpublic void write_char(CodeSet.OutputBuffer buffer, char c, boolean write_bom, boolean write_length, int giop_minor)
buffer
- the buffer to which the character is writtenc
- the character to writewrite_bom
- true if a byte-order-marker (indicating big-endian) should be writtenwrite_length
- true if the length of the character should be writtengiop_minor
- the low-order byte of the giop version (1.x is assumed)public int get_wstring_size(String string, int startPos, int currentPos)
string
- the string writtenstartPos
- the starting position at which the string was writtencurrentPos
- the current buffer positionprotected final String readGiop12WString(CodeSet.InputBuffer buffer, int size, int giop_minor)
buffer
- the buffer from which to read the stringsize
- the length indicator already readgiop_minor
- the low-order byte of the giop version (must be >= 2)public static void main(String[] args)
Copyright © 2016 JacORB. All rights reserved.