code: public static Attachment fromBinaryFile( File file, MediaType mediaType ) throws IOException {
          FileInputStream stream = new FileInputStream( file );
          try {
              return fromBinaryInputStream( stream, mediaType );
          } finally {
              ResourceUtil.close( stream );
          }
      }
docs: Creates an attachment from the given binary file {@code file}.
  The content of the file will be transformed into a Base64 encoded string.
  @throws IOException if an I/O error occurs
  @throws java.lang.IllegalArgumentException if mediaType is not binary