(File file)
| 157 | } |
| 158 | |
| 159 | public static byte[] readToByte(File file) { |
| 160 | try (FileInputStream is = new FileInputStream(file)) { |
| 161 | return readToByte(is); |
| 162 | } catch (IOException e) { |
| 163 | return new byte[0]; |
| 164 | } |
| 165 | } |
| 166 | |
| 167 | private static byte[] readToByte(InputStream is) throws IOException { |
| 168 | try (InputStream input = is; ByteArrayOutputStream bos = new ByteArrayOutputStream()) { |