Reset the encoding used to convert the bytes coming in before they are handed as Strings to {@Link #message(char[], int)}.
(Charset charset)
| 295 | * before they are handed as Strings to {@Link #message(char[], int)}. |
| 296 | */ |
| 297 | public synchronized void resetDecoding(Charset charset) { |
| 298 | bytesToStrings = charset.newDecoder() |
| 299 | .onMalformedInput(CodingErrorAction.REPLACE) |
| 300 | .onUnmappableCharacter(CodingErrorAction.REPLACE) |
| 301 | .replaceWith("\u2e2e"); |
| 302 | } |
| 303 | |
| 304 | static public List<String> list() { |
| 305 | return Arrays.asList(SerialPortList.getPortNames()); |