How to convert file to byte array (byte[]) example, 파일 객체 바이트로 변환하기 예제코드, java/cpp/c++/scalar
파일 객체를 만들어주고, 파일객체의 path를
java.nio.file.Files 의 readAllBytes 함수에 넣어 사용한다.
Make file object first, and use that file path in readAllBytes method in java.nio.file.Files
Example code...
예제코드
byte[] array = Files.readAllBytes(new File("file/path.txt").toPath());