Package org.dellroad.hl7.llp
Interface CharsetDecoder
-
- All Known Implementing Classes:
MSH18CharsetDecoder
public interface CharsetDecoderStrategy interface for determining the character encoding to use when reading and writing HL7 messages.
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description CharsetcharsetForIncomingMessage(byte[] buf, int offset, int length)Determine the character encoding to use for an incoming HL7 message.CharsetcharsetForOutgoingMessage(HL7Message msg)Determine the character encoding to use for an outgoing HL7 message.static CharsetDecoderfixed(Charset charset)Create aCharsetDecoderthat always returns the givenCharset.
-
-
-
Method Detail
-
charsetForIncomingMessage
Charset charsetForIncomingMessage(byte[] buf, int offset, int length)
Determine the character encoding to use for an incoming HL7 message.- Parameters:
buf- raw HL7 message bufferoffset- HL7 message offset inbuflength- HL7 message length inbuf- Returns:
- character encoding to use for the given message (never null)
- Throws:
IllegalArgumentException- ifbufis nullArrayIndexOutOfBoundsException- ifoffsetand/orlengthare invalid
-
charsetForOutgoingMessage
Charset charsetForOutgoingMessage(HL7Message msg)
Determine the character encoding to use for an outgoing HL7 message.- Parameters:
msg- HL7 message- Returns:
- character encoding to use for the given message (never null)
- Throws:
IllegalArgumentException- ifmsgis null
-
fixed
static CharsetDecoder fixed(Charset charset)
Create aCharsetDecoderthat always returns the givenCharset.- Parameters:
charset- character encoding to use- Returns:
- a fixed-answer
CharsetDecoder - Throws:
IllegalArgumentException- ifcharsetis null
-
-