Trispark JDT
2.50.13

com.archimed.dicom.charset
Class DicomCharsetCoder

java.lang.Object
  extended by com.archimed.dicom.charset.DicomCharsetCoder

public class DicomCharsetCoder
extends java.lang.Object

Utility class that converts byte sequences into Strings according to the specified DICOM character repertoire.

Since:
2.0

Field Summary
static byte ESC
           
protected  JdtLogger log
           
 
Constructor Summary
DicomCharsetCoder()
           
 
Method Summary
 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)
          encodes a String into a byte sequence with the first character repertoire in the array of specified character repertoires.
 byte[] encode(java.lang.String str, DicomCharset dicomCharset, boolean escapeSequence)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ESC

public static final byte ESC
See Also:
Constant Field Values

log

protected JdtLogger log
Constructor Detail

DicomCharsetCoder

public DicomCharsetCoder()
Method Detail

encode

public byte[] encode(java.lang.String str)
              throws DicomCharsetException
encodes a String into a byte sequence according to the default character repertoire (US-ASCII).

Parameters:
str - String
Returns:
byte[]
Throws:
DicomCharsetException

encode

public byte[] encode(java.lang.String str,
                     DicomCharset dicomCharset)
encodes a String into a byte sequence according to the specified character repertoire. No escape sequences are inserted.

Parameters:
str - String
dicomCharset - DicomCharset
Returns:
byte[]

encode

public byte[] encode(java.lang.String str,
                     DicomCharset dicomCharset,
                     boolean escapeSequence)

encode

public byte[] encode(java.lang.String str,
                     DicomCharset[] dicomCharsets)
encodes a String into a byte sequence with the first character repertoire in the array of specified character repertoires.

Parameters:
str - String
dicomCharsets - DicomCharset[]
Returns:
byte[]

decode

public java.lang.String decode(byte[] ar)
                        throws DicomCharsetException
decodes a byte sequence into a String with the default character repertoire (US-ASCII)

Parameters:
ar - byte[]
Returns:
String
Throws:
DicomCharsetException

decode

public java.lang.String decode(byte[] ar,
                               int offset,
                               int len)
                        throws DicomCharsetException
decodes a byte sequence into a String with the default character repertoire (US-ASCII)

Parameters:
ar - byte[]
offset - int
len - int
Returns:
String
Throws:
DicomCharsetException

decode

public java.lang.String decode(byte[] ar,
                               DicomCharset[] dicomCharsets)
                        throws DicomCharsetException
decodes a byte sequence into a String making using of the specified character repertoires, taking into account the escape mechanism for character repertoires.

Parameters:
ar - byte[]
dicomCharsets - DicomCharset[]
Returns:
String
Throws:
DicomCharsetException

decode

public java.lang.String decode(byte[] ar,
                               int offset,
                               int len,
                               DicomCharset[] dicomCharsets)
                        throws DicomCharsetException
decodes a byte sequence into a String making using of the specified character repertoires, taking into account the escape mechanism for character repertoires.

Parameters:
ar - byte[]
offset - int
len - int
dicomCharsets - DicomCharset[]
Returns:
String
Throws:
DicomCharsetException

Trispark JDT
2.50.13

Copyright © 1999-2008 Trispark. All Rights Reserved.