Fix issue in CommonsHttpSolrServer where a Reader is copied to an OutputStream using default encoding

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1066889 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Uwe Schindler 2011-02-03 17:41:53 +00:00
parent 7b32753293
commit 69ad01cb98
1 changed files with 3 additions and 4 deletions

View File

@ -20,7 +20,6 @@ package org.apache.solr.client.solrj.impl;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.Reader;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.*;
@ -335,11 +334,11 @@ public class CommonsHttpSolrServer extends SolrServer
@Override
protected void sendData(OutputStream out)
throws IOException {
Reader reader = c.getReader();
InputStream in = c.getStream();
try {
IOUtils.copy(reader, out);
IOUtils.copy(in, out);
} finally {
reader.close();
in.close();
}
}
});