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.IOException;
import java.io.InputStream; import java.io.InputStream;
import java.io.OutputStream; import java.io.OutputStream;
import java.io.Reader;
import java.net.MalformedURLException; import java.net.MalformedURLException;
import java.net.URL; import java.net.URL;
import java.util.*; import java.util.*;
@ -335,11 +334,11 @@ public class CommonsHttpSolrServer extends SolrServer
@Override @Override
protected void sendData(OutputStream out) protected void sendData(OutputStream out)
throws IOException { throws IOException {
Reader reader = c.getReader(); InputStream in = c.getStream();
try { try {
IOUtils.copy(reader, out); IOUtils.copy(in, out);
} finally { } finally {
reader.close(); in.close();
} }
} }
}); });