import java.nio.file.{Files, Paths}string filepath="1.jpg"byte[] bytes = Files.readAllBytes(Paths.get(filepath))