class Crypto {

    public static String encodedFile(File f) {
        try (FileInputStream in = new FileInputStream(f)) {
            int fileLength = (int) f.length();
            byte [] buf = new byte[fileLength];
            ///CLOVER:OFF
            if (in.read(buf) != fileLength) {
                LOG.error("encodedFile: Unable to read {} bytes from file {}", fileLength, f.getAbsolutePath());
                throw new IOException("Unable to read file");
            }
            ///CLOVER:ON
            return ybase64(buf);
        } catch (FileNotFoundException e) {
            LOG.error("encodedFile: Caught FileNotFoundException while attempting to read encoded file: "
                    + f.getAbsolutePath());
            throw new RuntimeException(e);
            ///CLOVER:OFF
        } catch (IOException e) {
            LOG.error("encodedFile: Caught IOException while attempting to read encoded file: "
                    + f.getAbsolutePath());
            throw new RuntimeException(e);
        }
        ///CLOVER:ON
    }

}