org.apache.hc.client5.http.entity.mime

## Class HttpRFC7578Multipart

- java.lang.Object
- - org.apache.hc.client5.http.entity.mime.HttpRFC7578Multipart

    public class HttpRFC7578Multipart
    extends Object

### Constructor Summary

Constructors
Constructor and Description
`HttpRFC7578Multipart(Charset charset, String boundary, List<MultipartPart> parts)`

### Method Summary

Methods
`protected void` `formatMultipartHeader(MultipartPart part, OutputStream out)` Write the multipart header fields; depends on the style.
`List<MultipartPart>` `getParts()`
`long` `getTotalLength()` Determines the total length of the multipart content (content length of individual parts plus that of extra elements required to delimit the parts from one another).
`void` `writeTo(OutputStream out)` Writes out the content in the multipart/form encoding.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### HttpRFC7578Multipart

    public HttpRFC7578Multipart(Charset charset,
                        String boundary,
                        List<MultipartPart> parts)

### Method Detail

#### getParts

    public List<MultipartPart> getParts()

#### formatMultipartHeader

    protected void formatMultipartHeader(MultipartPart part,
                             OutputStream out)
                                  throws IOException

Write the multipart header fields; depends on the style.

Throws:
  `IOException`

#### writeTo

    public void writeTo(OutputStream out)
                 throws IOException

Writes out the content in the multipart/form encoding. This method produces slightly different formatting depending on its compatibility mode.

Throws:
  `IOException`

#### getTotalLength

    public long getTotalLength()

Determines the total length of the multipart content (content length of individual parts plus that of extra elements required to delimit the parts from one another). If any of the @{link BodyPart}s contained in this object is of a streaming entity of unknown length the total length is also unknown.

This method buffers only a small amount of data in order to determine the total length of the entire entity. The content of individual parts is not buffered.

Returns:
  total length of the multipart entity if known, `-1` otherwise.