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)
| 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. |
nothing calls this directly
no test coverage detected