Skip to content

armgit / solr

Public Imported from GitHub
0

Apache Solr open-source search software

LUCENE-4588 (cont): simplify test input stream crration.

Doron Cohencfdb20fe8c61
diff --git a/lucene/benchmark/src/test/org/apache/lucene/benchmark/byTask/feeds/EnwikiContentSourceTest.java b/lucene/benchmark/src/test/org/apache/lucene/benchmark/byTask/feeds/EnwikiContentSourceTest.java
index c630bcb0c4b..785cd4ffd76 100644
--- a/lucene/benchmark/src/test/org/apache/lucene/benchmark/byTask/feeds/EnwikiContentSourceTest.java
+++ b/lucene/benchmark/src/test/org/apache/lucene/benchmark/byTask/feeds/EnwikiContentSourceTest.java
@@ -43,14 +43,7 @@ public class EnwikiContentSourceTest extends LuceneTestCase {
@Override
protected InputStream openInputStream() throws IOException {
- // StringBufferInputStream would have been handy, but it is forbidden
- ByteArrayOutputStream baos = new ByteArrayOutputStream();
- OutputStreamWriter w = new OutputStreamWriter(baos, IOUtils.CHARSET_UTF_8);
- w.write(docs);
- w.close();
- byte[] byteArray = baos.toByteArray();
- baos.close();
- return new ByteArrayInputStream(byteArray);
+ return new ByteArrayInputStream(docs.getBytes(IOUtils.CHARSET_UTF_8));
}
}