lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Doron Cohen <cdor...@gmail.com>
Subject Re: svn commit: r1417871 - /lucene/dev/trunk/lucene/benchmark/src/test/org/apache/lucene/benchmark/byTask/feeds/EnwikiContentSourceTest.java
Date Thu, 06 Dec 2012 14:42:58 GMT
... no idea ... :)
done.
thanks Uwe


On Thu, Dec 6, 2012 at 4:03 PM, Uwe Schindler <uwe@thetaphi.de> wrote:

> Why not simply use:
>
> new ByteArrayInputStream(docs.getBytes(IOUtils.CHARSET_UTF_8))
>
> -----
> Uwe Schindler
> H.-H.-Meier-Allee 63, D-28213 Bremen
> http://www.thetaphi.de
> eMail: uwe@thetaphi.de
>
>
> > -----Original Message-----
> > From: doronc@apache.org [mailto:doronc@apache.org]
> > Sent: Thursday, December 06, 2012 2:34 PM
> > To: commits@lucene.apache.org
> > Subject: svn commit: r1417871 -
> > /lucene/dev/trunk/lucene/benchmark/src/test/org/apache/lucene/benchm
> > ark/byTask/feeds/EnwikiContentSourceTest.java
> >
> > Author: doronc
> > Date: Thu Dec  6 13:33:34 2012
> > New Revision: 1417871
> >
> > URL: http://svn.apache.org/viewvc?rev=1417871&view=rev
> > Log:
> > LUCENE-4588 (cont): (EnwikiContentSource fixes) avoid using the forbidden
> > StringBufferInputStream..
> >
> > Modified:
> >
> > lucene/dev/trunk/lucene/benchmark/src/test/org/apache/lucene/benchma
> > rk/byTask/feeds/EnwikiContentSourceTest.java
> >
> > Modified:
> > lucene/dev/trunk/lucene/benchmark/src/test/org/apache/lucene/benchma
> > rk/byTask/feeds/EnwikiContentSourceTest.java
> > URL:
> > http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/benchmark/src/tes
> > t/org/apache/lucene/benchmark/byTask/feeds/EnwikiContentSourceTest.ja
> > va?rev=1417871&r1=1417870&r2=1417871&view=diff
> > ==========================================================
> > ====================
> > ---
> > lucene/dev/trunk/lucene/benchmark/src/test/org/apache/lucene/benchma
> > rk/byTask/feeds/EnwikiContentSourceTest.java (original)
> > +++
> > lucene/dev/trunk/lucene/benchmark/src/test/org/apache/lucene/benchma
> > +++ rk/byTask/feeds/EnwikiContentSourceTest.java Thu Dec  6 13:33:34
> > +++ 2012
> > @@ -17,14 +17,17 @@ package org.apache.lucene.benchmark.byTa
> >   * limitations under the License.
> >   */
> >
> > +import java.io.ByteArrayInputStream;
> > +import java.io.ByteArrayOutputStream;
> >  import java.io.IOException;
> >  import java.io.InputStream;
> > +import java.io.OutputStreamWriter;
> >  import java.text.ParseException;
> >  import java.util.Properties;
> >
> >  import org.apache.lucene.benchmark.byTask.utils.Config;
> > +import org.apache.lucene.util.IOUtils;
> >  import org.apache.lucene.util.LuceneTestCase;
> > -import org.junit.Ignore;
> >  import org.junit.Test;
> >
> >  public class EnwikiContentSourceTest extends LuceneTestCase { @@ -38,10
> > +41,16 @@ public class EnwikiContentSourceTest ext
> >        this.docs = docs;
> >      }
> >
> > -    @SuppressWarnings("deprecation") // fine for the characters used in
> this
> > test
> >      @Override
> >      protected InputStream openInputStream() throws IOException {
> > -      return new java.io.StringBufferInputStream(docs);
> > +      // 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);
> >      }
> >
> >    }
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
> For additional commands, e-mail: dev-help@lucene.apache.org
>
>

Mime
View raw message