2011-03-20 54 views
0

我想添加一個已編寫的流到我的multipartentity以將其上傳到我的servlet,但我不知道該怎麼做...... Emm然後MultipartEntity與addPart相當有限(.. ...,)方法參數。 我沒有找到那方面的例子,所以我需要你的幫助。 請分享任何有用的摘要和想法。HttpClient-將CipherInputStream添加到MultipartEntity

任何意見表示讚賞。

Andrew

P.S.我正在使用HttpClient 4

回答

2

您是否嘗試將CipherInputStream封裝到org.apache.http.entity.mime.content.InputStreamBody

然後,您可以將其封裝在org.apache.http.entity.mime.FormBodyPart中,該代碼可以通過addBodyPart()添加到您的HttpMultipart實例中。

+0

謝謝你的評論... – user592704 2011-03-21 01:36:14

+0

不,我沒有嘗試封裝,因爲我想上傳大文件,要求緩衝區讀取no有outOfMemory錯誤... – user592704 2011-03-21 01:37:45

+0

問題是,addPart()要求FileInputStream作爲一個參數,但CipherInputStream加密結果是FileOutputStream :( – user592704 2011-03-21 01:39:31

相關問題