Package org.apache.lucene.store

Examples of org.apache.lucene.store.DataOutput.writeBytes()


      while(written < numBytes) {
        if (random().nextInt(10) == 7) {
          out.writeByte(answer[written++]);
        } else {
          int chunk = Math.min(random().nextInt(1000), numBytes - written);
          out.writeBytes(answer, written, chunk);
          written += chunk;
        }
      }

      final PagedBytes.Reader reader = p.freeze(random.nextBoolean());
View Full Code Here


      while(written < numBytes) {
        if (random().nextInt(10) == 7) {
          out.writeByte(answer[written++]);
        } else {
          int chunk = Math.min(random().nextInt(1000), numBytes - written);
          out.writeBytes(answer, written, chunk);
          written += chunk;
        }
      }

      final PagedBytes.Reader reader = p.freeze(random.nextBoolean());
View Full Code Here

    OutputStream os = new FileOutputStream(filename);
    try {
      os = new BufferedOutputStream(os);
      final DataOutput out = new OutputStreamDataOutput(os);
      CodecUtil.writeHeader(out, CharacterDefinition.HEADER, CharacterDefinition.VERSION);
      out.writeBytes(characterCategoryMap, 0, characterCategoryMap.length);
      for (int i = 0; i < CharacterDefinition.CLASS_COUNT; i++) {
        final byte b = (byte) (
          (invokeMap[i] ? 0x01 : 0x00) |
          (groupMap[i] ? 0x02 : 0x00)
        );
View Full Code Here

      while(written < numBytes) {
        if (random().nextInt(10) == 7) {
          out.writeByte(answer[written++]);
        } else {
          int chunk = Math.min(random().nextInt(1000), numBytes - written);
          out.writeBytes(answer, written, chunk);
          written += chunk;
        }
      }

      final PagedBytes.Reader reader = p.freeze(random.nextBoolean());
View Full Code Here

      while(written < numBytes) {
        if (random.nextInt(10) == 7) {
          out.writeByte(answer[written++]);
        } else {
          int chunk = Math.min(random.nextInt(1000), numBytes - written);
          out.writeBytes(answer, written, chunk);
          written += chunk;
        }
      }

      final PagedBytes.Reader reader = p.freeze(random.nextBoolean());
View Full Code Here

  public void testLengthPrefixAcrossTwoBlocks() throws Exception {
    final PagedBytes p = new PagedBytes(10);
    final DataOutput out = p.getDataOutput();
    final byte[] bytes1 = new byte[1000];
    random.nextBytes(bytes1);
    out.writeBytes(bytes1, 0, bytes1.length);
    out.writeByte((byte) 40);
    final byte[] bytes2 = new byte[40];
    random.nextBytes(bytes2);
    out.writeBytes(bytes2, 0, bytes2.length);
View Full Code Here

    random.nextBytes(bytes1);
    out.writeBytes(bytes1, 0, bytes1.length);
    out.writeByte((byte) 40);
    final byte[] bytes2 = new byte[40];
    random.nextBytes(bytes2);
    out.writeBytes(bytes2, 0, bytes2.length);

    final PagedBytes.Reader reader = p.freeze(random.nextBoolean());
    BytesRef answer = reader.fillSliceWithPrefix(new BytesRef(), 1000);
    assertEquals(40, answer.length);
    for(int i=0;i<40;i++) {
View Full Code Here

    OutputStream os = new FileOutputStream(filename);
    try {
      os = new BufferedOutputStream(os);
      final DataOutput out = new OutputStreamDataOutput(os);
      CodecUtil.writeHeader(out, CharacterDefinition.HEADER, CharacterDefinition.VERSION);
      out.writeBytes(characterCategoryMap, 0, characterCategoryMap.length);
      for (int i = 0; i < CharacterDefinition.CLASS_COUNT; i++) {
        final byte b = (byte) (
          (invokeMap[i] ? 0x01 : 0x00) |
          (groupMap[i] ? 0x02 : 0x00)
        );
View Full Code Here

      while(written < numBytes) {
        if (random.nextInt(10) == 7) {
          out.writeByte(answer[written++]);
        } else {
          int chunk = Math.min(random.nextInt(1000), numBytes - written);
          out.writeBytes(answer, written, chunk);
          written += chunk;
        }
      }

      p.freeze(random.nextBoolean());
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.