HI, for data type "OMMTypes.RMTES_STRING", I use below code to get the string to display it:
OMMDataBuffer buffer = (OMMDataBuffer)entryData
String dataDisplay = new String(buffer.getBytes, new RmtesCharsetProvider().charsetForName("RMTES"))
Most of the time it work but I can also get
java.nio.charset.CoderMalfunctionError: java.lang.IndexOutOfBoundsException
at java.nio.charset.CharsetDecoder.decode(CharsetDecoder.java:587) ~[?:?]
at java.lang.String.decodeWithDecoder(String.java:1210) ~[?:?]
at java.lang.String.<init>(String.java:665) ~[?:?]
at java.lang.String.<init>(String.java:1387) ~[?:?]
Caused by: java.lang.IndexOutOfBoundsException
at java.nio.Buffer.checkIndex(Buffer.java:743) ~[?:?]
at java.nio.HeapByteBuffer.get(HeapByteBuffer.java:169) ~[?:?]
at com.reuters.rmtes.RmtesCharsetDecoder.parseLangCode(Unknown Source) ~[feed-assembly-2.6.13.jar:2.6.13]
at com.reuters.rmtes.RmtesCharsetDecoder.parseEscSeq(Unknown Source) ~[feed-assembly-2.6.13.jar:2.6.13]
at com.reuters.rmtes.RmtesCharsetDecoder.decodeLoop(Unknown Source) ~[feed-assembly-2.6.13.jar:2.6.13]
at java.nio.charset.CharsetDecoder.decode(CharsetDecoder.java:585) ~[?:?]
Just wonder how can I prevent that Exception with some kind of detection?