MCPcopy Create free account
hub / github.com/antlr/codebuff / toByteArray

Method toByteArray

corpus/java/training/guava/io/Files.java:248–250  ·  view source on GitHub ↗

Reads all bytes from a file into a byte array. @param file the file to read from @return a byte array containing all the bytes from file @throws IllegalArgumentException if the file is bigger than the largest possible byte array (2^31 - 1) @throws IOException if an I/O error occurs

(File file)

Source from the content-addressed store, hash-verified

246 * @throws IOException if an I/O error occurs
247 */
248 public static byte[] toByteArray(File file) throws IOException {
249 return asByteSource(file).read();
250 }
251
252 /**
253 * Reads all characters from a file into a {@link String}, using the given character set.

Callers

nothing calls this directly

Calls 2

asByteSourceMethod · 0.95
readMethod · 0.45

Tested by

no test coverage detected