/** * Reads the given file as bytes * * @param file * The file to read * @return The contents of the file * @throws IOException * if there is an issue reading the file. */ public static byte[] readFileBytes(final File file) throws IOException { final InputStream ins = new FileInputStream(file); return IOUtil.readInputStreamBytes(ins, true); }
/** * Reads the given file as bytes * * @param file * The file to read * @return The contents of the file * @throws IOException * iff there is an issue reading the file. */ public static byte[] readFileBytes(File file) throws IOException { InputStream ins = new FileInputStream(file); byte[] bytes = IOUtil.readInputStreamBytes(ins, true); return bytes; }
/** * Reads the given file as bytes * * @param file * The file to read * @return The contents of the file * @throws IOException * if there is an issue reading the file. */ public static byte[] readFileBytes(final File file) throws IOException { final InputStream ins = new FileInputStream(file); return IOUtil.readInputStreamBytes(ins, true); }
/** * Make a blob conversion * * @param blobValue * blob * @return a converted value * @throws SQLException */ public static byte[] blob2ByteArray(Blob blobValue) throws SQLException { byte[] newValue = null; // convert from Blob to byte[] InputStream is = blobValue.getBinaryStream(); try { newValue = IOUtil.readInputStreamBytes(is, true); } catch (IOException e) { throw ConnectorException.wrap(e); } return newValue; }