code: public void addFileField(String name, String fileName, InputStream inputStream)
        throws IOException {
      writer.append("--").append(boundary).append(LINE_BREAK);
      writer.append("Content-Disposition: form-data; name=\"").append(name)
              .append("\"; filename=\"").append(fileName).append("\"").append(LINE_BREAK);
  
      String probableContentType = URLConnection.guessContentTypeFromName(fileName);
      writer.append("Content-Type: ").append(probableContentType).append(LINE_BREAK);
      writer.append("Content-Transfer-Encoding: binary").append(LINE_BREAK);
      writer.append(LINE_BREAK);
      writer.flush();
  
      streamToOutput(inputStream);
  
      writer.append(LINE_BREAK);
      writer.flush();
    }
docs: Adds a file field to the multipart message, but takes in an InputStream instead of
  just a file to read bytes from.
  
  @param name          Field name
  @param fileName      Name of the "file" being uploaded.
  @param inputStream   Stream of bytes to use in place of a file.
  @throws IOException  Thrown when writing / reading from streams fails.