docs: public static String encode( java.io.InputStream source,
                                   int options ) {
          if (source == null) {
              throw new IllegalArgumentException("Source cannot be null");
          }
          java.io.ByteArrayOutputStream baos = new java.io.ByteArrayOutputStream();
          Base64.OutputStream b64os = new Base64.OutputStream(baos, ENCODE | options);
          BufferedInputStream input = new BufferedInputStream(source);
          java.io.OutputStream output = b64os;
  
          boolean error = false;
          try {
              if ((options & GZIP) == GZIP) {
                  output = new java.util.zip.GZIPOutputStream(output);
              }
              int numRead = 0;
              byte[] buffer = new byte[1024];
              while ((numRead = input.read(buffer)) > -1) {
                  output.write(buffer, 0, numRead);
              }
              output.close();
          } catch (IOException e) {
              error = true;
              throw new RuntimeException(e); // error using reading from byte array!
          } finally {
              try {
                  input.close();
              } catch (IOException e) {
                  if (!error) new RuntimeException(e); // error closing input stream
              }
          }
  
          // Return value according to relevant encoding.
          try {
              return new String(baos.toByteArray(), PREFERRED_ENCODING);
          } catch (java.io.UnsupportedEncodingException uue) {
              return new String(baos.toByteArray());
          }
      }