Examples of reinit()


Examples of org.apache.lucene.util.UnsafeByteArrayOutputStream.reInit()

  }
 
  @Test(expected=IllegalArgumentException.class)
  public void testIllegalBufferSize() throws Exception {
    UnsafeByteArrayOutputStream ubaos = new UnsafeByteArrayOutputStream();
    ubaos.reInit(new byte[0]);
  }

}
View Full Code Here

Examples of org.apache.lucene.util.encoding.DGapIntDecoder.reInit()

    clps.appendIntToStream(Integer.MAX_VALUE);

    ByteArrayInputStream bais = new ByteArrayInputStream(clps
        .convertStreamToByteArray());
    IntDecoder decoder = new DGapIntDecoder(new NOnesIntDecoder(3));
    decoder.reInit(bais);
    assertEquals("Wrong value in byte stream", 1, decoder.decode());
    assertEquals("Wrong value in byte stream", 10, decoder.decode());
    assertEquals("Wrong value in byte stream", 100, decoder.decode());
    assertEquals("Wrong value in byte stream", 1000, decoder.decode());
    assertEquals("Wrong value in byte stream", 10000, decoder.decode());
View Full Code Here

Examples of org.apache.lucene.util.encoding.DGapIntDecoder.reInit()

    assertEquals("Wrong value in byte stream", 1000000000, decoder.decode());
    assertEquals("Wrong value in byte stream", Integer.MAX_VALUE, decoder.decode());
    assertEquals("End of stream not reached", IntDecoder.EOS, decoder.decode());

    clps.reset();
    decoder.reInit(bais);
    assertEquals("End of stream not reached", IntDecoder.EOS, decoder.decode());
  }

}
View Full Code Here

Examples of org.apache.lucene.util.encoding.IntDecoder.reInit()

    clps.appendIntToStream(Integer.MAX_VALUE);

    ByteArrayInputStream bais = new ByteArrayInputStream(clps
        .convertStreamToByteArray());
    IntDecoder decoder = new DGapIntDecoder(new NOnesIntDecoder(3));
    decoder.reInit(bais);
    assertEquals("Wrong value in byte stream", 1, decoder.decode());
    assertEquals("Wrong value in byte stream", 10, decoder.decode());
    assertEquals("Wrong value in byte stream", 100, decoder.decode());
    assertEquals("Wrong value in byte stream", 1000, decoder.decode());
    assertEquals("Wrong value in byte stream", 10000, decoder.decode());
View Full Code Here

Examples of org.apache.lucene.util.encoding.IntDecoder.reInit()

    assertEquals("Wrong value in byte stream", 1000000000, decoder.decode());
    assertEquals("Wrong value in byte stream", Integer.MAX_VALUE, decoder.decode());
    assertEquals("End of stream not reached", IntDecoder.EOS, decoder.decode());

    clps.reset();
    decoder.reInit(bais);
    assertEquals("End of stream not reached", IntDecoder.EOS, decoder.decode());
  }

}
View Full Code Here

Examples of org.apache.lucene.util.encoding.IntDecoder.reInit()

    long encodeTime = endTime - startTime;

    ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray());
    IntDecoder decoder = encoder.createMatchingDecoder();
    decoder.reInit(bais);
   
    // -- Looping 100 times as a warm up --------------------------
    for (int i = 100; i != 0; --i) {
      bais.mark(baos.size());
      while (decoder.decode() != IntDecoder.EOS) {
View Full Code Here

Examples of org.apache.lucene.util.encoding.IntDecoder.reInit()

    for (int i = 100; i != 0; --i) {
      bais.mark(baos.size());
      while (decoder.decode() != IntDecoder.EOS) {
      }
      bais.reset();
      decoder.reInit(bais);
    }
    // -----------------------------------------------------------

    decoder.reInit(bais);
    startTime = System.currentTimeMillis();
View Full Code Here

Examples of org.apache.lucene.util.encoding.IntDecoder.reInit()

      bais.reset();
      decoder.reInit(bais);
    }
    // -----------------------------------------------------------

    decoder.reInit(bais);
    startTime = System.currentTimeMillis();
    for (int i = loopFactor; i > 0; --i) {
      bais.mark(baos.size());
      while (decoder.decode() != IntDecoder.EOS) {
      }
View Full Code Here

Examples of org.apache.lucene.util.encoding.IntDecoder.reInit()

    for (int i = loopFactor; i > 0; --i) {
      bais.mark(baos.size());
      while (decoder.decode() != IntDecoder.EOS) {
      }
      bais.reset();
      decoder.reInit(bais);
    }

    endTime = System.currentTimeMillis();
    long decodeTime = endTime - startTime;
View Full Code Here

Examples of org.apache.lucene.util.encoding.IntDecoder.reInit()

    ByteArrayOutputStream baos = new ByteArrayOutputStream();
    enc.reInit(baos);
    enc.encode(-1);
   
    IntDecoder dec = enc.createMatchingDecoder();
    dec.reInit(new ByteArrayInputStream(baos.toByteArray()));
    assertEquals(-1, dec.decode());
  }
 
  @Test
  public void testSimpleInt() {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.