Reading all bytes to a byte

suggest change

Java 7 introduced the very useful Files class

import java.nio.file.Files;
import java.nio.file.Paths;
import java.nio.file.Path;

Path path = Paths.get("path/to/file");

try {
    byte[] data = Files.readAllBytes(path);
} catch(IOException e) {

Feedback about page:

Optional: your email if you want me to get back to you:

Table Of Contents