Neow3jPluginUtils { static void writeToFile(File file, byte[] content) throws IOException { FileOutputStream outputStream = new FileOutputStream(file); try { outputStream.write(content); } finally { outputStream.close(); } }    }
@Test public void testWriteToFile() throws IOException { Path tempFile = Files.createTempFile("test", "neow3jPlugin"); byte[] bytesToBeWritten = new byte[]{0x00, 0x01, 0x02}; Neow3jPluginUtils.writeToFile(tempFile.toFile(), bytesToBeWritten); byte[] readBytes = Files.readAllBytes(tempFile); assertThat(readBytes, is(bytesToBeWritten)); }