public interface MCstringEncoder
The toolkit uses an instance of this interface to encode/decode values for LO, LT, SH, ST, UT, PN type attributes according to the character set specified by the Specific Character Set attribute.
By default, the toolkit uses an internal string encoder which deals with most DICOM character
sets, but an application has the option to implement a custom string encoder based on this
interface. A custom string encoder must be registered using the MC.setStringEncoder(MCstringEncoder)
method.
Modifier and Type | Method and Description |
---|---|
java.lang.String |
decode(byte[] value,
int offset,
int len,
java.lang.String[] characterSets)
Called by the toolkit to decode a byte array representing a DICOM encoded text value.
|
byte[] |
encode(java.lang.String value,
java.lang.String[] characterSets)
Called by the toolkit to encode a text value into a byte representation.
|
java.lang.String decode(byte[] value, int offset, int len, java.lang.String[] characterSets)
value
- The byte array containing the encoded value.offset
- The offset in the value byte array where the encoded value begins.len
- The number of bytes of the encoded value.characterSets
- The character sets as specified by the Specific Character Set
Attribute.byte[] encode(java.lang.String value, java.lang.String[] characterSets)
value
- The value to be encoded.characterSets
- The character sets as specified by the Specific Character Set
Attribute.