docs: public static String encodeFromFile(String filename) throws java.io.IOException {
  
          String encodedData = null;
          Base64.InputStream bis = null;
          try {
              // Set up some useful variables
              Path file = Paths.get(filename);
              byte[] buffer = new byte[Math.max((int) (Files.size(file) * 1.4 + 1), 40)]; // Need max() for math on small files
                                                                                       // (v2.2.1); Need +1 for a few corner cases
                                                                                       // (v2.3.5)
              int length = 0;
              int numBytes;
  
              // Open a stream
              bis = new Base64.InputStream(new java.io.BufferedInputStream(Files.newInputStream(file)), Base64.ENCODE);
  
              // Read until done
              while ((numBytes = bis.read(buffer, length, 4096)) >= 0) {
                  length += numBytes;
              } // end while
  
              // Save in a variable to return
              encodedData = new String(buffer, 0, length, StandardCharsets.US_ASCII);
  
          } // end try
          catch (java.io.IOException e) {
              throw e; // Catch and release to execute finally{}
          } // end catch: java.io.IOException
          finally {
              try {
                  bis.close();
              } catch (Exception e) {
              }
          } // end finally
  
          return encodedData;
      }