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

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1417921 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Doron Cohen 2012-12-06 14:36:27 +00:00
parent b85d07d0dd
commit cfdb20fe8c
1 changed files with 1 additions and 8 deletions

View File

@ -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));
}
}