[caddx] Corrected try with resources on a test class (#9123)
Signed-off-by: Georgios Moutsos <georgios.moutsos@gmail.com>
This commit is contained in:
parent
55943502b5
commit
af735031c5
|
@ -41,8 +41,10 @@ public final class CaddxMessageReaderUtil {
|
||||||
* @return The raw bytes of a telegram
|
* @return The raw bytes of a telegram
|
||||||
*/
|
*/
|
||||||
public static byte[] readRawMessage(String messageName) {
|
public static byte[] readRawMessage(String messageName) {
|
||||||
try (InputStream is = CaddxMessageReaderUtil.class.getResourceAsStream(messageName + MESSAGE_EXT)) {
|
try (InputStream is = CaddxMessageReaderUtil.class.getResourceAsStream(messageName + MESSAGE_EXT);
|
||||||
String hexString = new BufferedReader(new InputStreamReader(is)).lines().collect(Collectors.joining("\n"));
|
InputStreamReader isr = new InputStreamReader(is);
|
||||||
|
BufferedReader br = new BufferedReader(isr)) {
|
||||||
|
String hexString = br.lines().collect(Collectors.joining("\n"));
|
||||||
|
|
||||||
return HexUtils.hexToBytes(hexString, " ");
|
return HexUtils.hexToBytes(hexString, " ");
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
|
|
Loading…
Reference in New Issue