mirror of https://github.com/apache/lucene.git
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:
parent
b85d07d0dd
commit
cfdb20fe8c
|
@ -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));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue