public class DicomCharsetCoder
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static char |
CARET |
static char |
CR |
static byte |
DELIMITER |
static char |
EQ |
static byte |
ESC |
static char |
FF |
static char |
LF |
protected JdtLogger |
log |
static char |
TAB |
Constructor and Description |
---|
DicomCharsetCoder() |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
decode(byte[] ar)
decodes a byte sequence into a String with the default
character repertoire (US-ASCII)
|
java.lang.String |
decode(byte[] ar,
DicomCharset[] dicomCharsets)
decodes a byte sequence into a String making using of
the specified character repertoires, taking
into account the escape mechanism for character repertoires.
|
java.lang.String |
decode(byte[] ar,
int offset,
int len)
decodes a byte sequence into a String with the default
character repertoire (US-ASCII)
|
java.lang.String |
decode(byte[] ar,
int offset,
int len,
DicomCharset[] dicomCharsets)
decodes a byte sequence into a String making using of
the specified character repertoires, taking
into account the escape mechanism for character repertoires.
|
byte[] |
encode(java.lang.String str)
encodes a String into a byte sequence according to the default
character repertoire (US-ASCII).
|
byte[] |
encode(java.lang.String str,
DicomCharset dicomCharset)
encodes a String into a byte sequence according to the
specified character repertoire.
|
byte[] |
encode(java.lang.String str,
DicomCharset[] dicomCharsets) |
byte[] |
encode(java.lang.String str,
DicomCharset[] dicomCharsets,
boolean startWithEscape)
encodes a String into a byte sequence with the
specified character repertoires.
|
byte[] |
encode(java.lang.String str,
DicomCharset dicomCharset,
boolean escapeSequence)
Delegates to {link encode(String,DicomCharset[],boolean}
|
java.util.List<byte[]> |
splitMultivaluedText(byte[] textBytes,
DicomCharset[] dicomCharsets)
splits a byte array containing multi-valued textual data with delimiter (0x5C)
into a list of byte arrays
This method is used internally by JDT during reading of a dicom file or raw dicom stream
for dicom data elements with value representation SH,LO,UC and PN
and when the specific character set attribute of the DicomObject is multi-valued.
|
public static final byte ESC
public static final char LF
public static final char CR
public static final char FF
public static final char TAB
public static final char CARET
public static final char EQ
public static final byte DELIMITER
protected JdtLogger log
public byte[] encode(java.lang.String str) throws DicomCharsetException
encode(String, DicomCharset)
with DicomCharset.DEFAULT as specified charset.str
- StringDicomCharsetException
- -public byte[] encode(java.lang.String str, DicomCharset dicomCharset)
str
- StringdicomCharset
- DicomCharsetpublic byte[] encode(java.lang.String str, DicomCharset[] dicomCharsets)
public byte[] encode(java.lang.String str, DicomCharset dicomCharset, boolean escapeSequence)
str
- StringdicomCharset
- DicomCharsetescapeSequence
- if true, start the encoding with an escape sequencepublic byte[] encode(java.lang.String str, DicomCharset[] dicomCharsets, boolean startWithEscape)
str
- String the String to be encodeddicomCharsets
- DicomCharset[] the charsets to be used for encodingstartWithEscape
- if true, start the encoding with an escape sequencepublic java.lang.String decode(byte[] ar) throws DicomCharsetException
ar
- byte[]DicomCharsetException
- -public java.lang.String decode(byte[] ar, int offset, int len) throws DicomCharsetException
ar
- byte[]offset
- intlen
- intDicomCharsetException
- -public java.lang.String decode(byte[] ar, DicomCharset[] dicomCharsets) throws DicomCharsetException
ar
- byte[]dicomCharsets
- DicomCharset[]DicomCharsetException
- -public java.lang.String decode(byte[] ar, int offset, int len, DicomCharset[] dicomCharsets) throws DicomCharsetException
ar
- byte[]offset
- intlen
- intdicomCharsets
- DicomCharset[]DicomCharsetException
- -public java.util.List<byte[]> splitMultivaluedText(byte[] textBytes, DicomCharset[] dicomCharsets) throws DicomCharsetException, java.io.IOException
textBytes
- -dicomCharsets
- -DicomCharsetException
- -java.io.IOException
- -