mirror of
https://github.com/openhab/openhab-addons.git
synced 2025-01-10 15:11:59 +01:00
[caddx] Corrected try with resources on a test class (#9124)
Signed-off-by: Georgios Moutsos <georgios.moutsos@gmail.com>
This commit is contained in:
parent
49a908c6ff
commit
3174ff8663
@ -41,8 +41,10 @@ public final class CaddxMessageReaderUtil {
|
||||
* @return The raw bytes of a telegram
|
||||
*/
|
||||
public static byte[] readRawMessage(String messageName) {
|
||||
try (InputStream is = CaddxMessageReaderUtil.class.getResourceAsStream(messageName + MESSAGE_EXT)) {
|
||||
String hexString = new BufferedReader(new InputStreamReader(is)).lines().collect(Collectors.joining("\n"));
|
||||
try (InputStream is = CaddxMessageReaderUtil.class.getResourceAsStream(messageName + MESSAGE_EXT);
|
||||
InputStreamReader isr = new InputStreamReader(is);
|
||||
BufferedReader br = new BufferedReader(isr)) {
|
||||
String hexString = br.lines().collect(Collectors.joining("\n"));
|
||||
|
||||
return HexUtils.hexToBytes(hexString, " ");
|
||||
} catch (IOException e) {
|
||||
|
Loading…
Reference in New Issue
Block a user