Reading all bytes to a byte
suggest changeJava 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) {
e.printStackTrace();
}
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents