[caddx] Corrected try with resources on a test class (#9124)

Signed-off-by: Georgios Moutsos <georgios.moutsos@gmail.com>
This commit is contained in:
Georgios Moutsos 2020-11-25 09:07:51 +02:00 committed by GitHub
parent 49a908c6ff
commit 3174ff8663
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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) {