@Override
  protected void write(Output output, String key, Object value) throws EncodeException {
    val file = (MultipartFile) value;
    writeFileMetadata(output, key, file.getOriginalFilename(), file.getContentType());

    byte[] bytes;
    try {
      bytes = file.getBytes();
    } catch (IOException ex) {
      throw new EncodeException("Getting multipart file's content bytes error", ex);
    }
    output.write(bytes);
  }
A Spring single file writer.

@author Artem Labazin
form-spring/src/main/java/feign/form/spring/SpringSingleMultipartFileWriter.java