         :param: fileName The filename to associate with the stream content in the `Content-Disposition` HTTP header.
         :param: mimeType The MIME type to associate with the stream content in the `Content-Type` HTTP header.
     */
-    public func appendBodyPart(#stream: NSInputStream, name: String, fileName: String, mimeType: String) {
+    public func appendBodyPart(#stream: NSInputStream, name: String, fileName: String, length: UInt64, mimeType: String) {
         let headers = contentHeaders(name: name, fileName: fileName, mimeType: mimeType)
-        let bodyPart = BodyPart(headers: headers, bodyStream: stream)
+        let bodyPart = BodyPart(headers: headers, bodyStream: stream, bodyContentLength: length)
 
         self.bodyParts.append(bodyPart)
     }

        let headers = contentHeaders(name: name)
        let bodyStream = NSInputStream(data: data)
        let bodyContentLength = UInt64(data.length)
        let bodyPart = BodyPart(headers: headers, bodyStream: bodyStream)

        self.bodyParts.append(bodyPart)
    }


    /// The `Content-Type` header value containing the boundary used to generate the `multipart/form-data`.
    public var contentType: String { return "multipart/form-data;boundary=\(self.boundaryKey)" }

    /// The content length of all body parts used to generate the `multipart/form-data` not including the boundaries.
    public var contentLength: UInt64 { return self.bodyParts.reduce(0) { $0 + $1.bodyContentLength } }

    private let stringEncoding: NSStringEncoding
    private let boundaryKey: String
