square/okhttp — pull request #969 by JakeWharton (2014-06-28 08:00:46+00:00)
Title: Update MultipartBuilder to support content length.

In order to track content length we need to convert the headers and boundary of a part to a Buffer eagerly. The length of this Buffer plus what each part's RequestBody reports allows tracking what the overall content length will be. The presence of any streaming body means the length of the entire multipart request is unknown.

Common parts of the boundary and header have been changed to raw byte[] to save the cost of allocation and UTF-8 encoding.

Closes #963.