public com.cloudant.client.api.model.Response saveAttachment(InputStream in, String name,
                                                                 String contentType) {
        Response couchDbResponse = db.saveAttachment(in, name, contentType);
        com.cloudant.client.api.model.Response response = new com.cloudant.client.api.model
                .Response(couchDbResponse);
        return response;
    }
public com . cloudant . client . api . model . Response saveAttachment ( InputStream in , String name , String contentType ) { Response couchDbResponse = db . saveAttachment ( in , name , contentType ) ; com . cloudant . client . api . model . Response response = new com . cloudant . client . api . model . Response ( couchDbResponse ) ; return response ; }
Creates an attachment from the specified InputStream and a new document with a generated
document ID.
<P>Example usage:</P>
<pre>
{@code
byte[] bytesToDB = "binary data".getBytes();
ByteArrayInputStream bytesIn = new ByteArrayInputStream(bytesToDB);
Response response = db.saveAttachment(bytesIn, "foo.txt", "text/plain");
}
</pre>
<p>To retrieve an attachment, see {@link #find(Class, String, Params)}</p>

@param in          The {@link InputStream} providing the binary data.
@param name        The attachment name.
@param contentType The attachment "Content-Type".
@return {@link com.cloudant.client.api.model.Response}
@see <a
href="https://console.bluemix.net/docs/services/Cloudant/api/attachments.html#attachments"
target="_blank">Attachments</a>