Package org.apache.lucene.util

Examples of org.apache.lucene.util.BytesRefBuilder.bytes()


                    }
                    for (int i = 0; i < count; ++i) {
                        final int length = in.readVInt();
                        final BytesRefBuilder scratch = refs[i];
                        scratch.grow(length);
                        in.readBytes(scratch.bytes(), 0, length);
                        scratch.setLength(length);
                    }
                }
            }
View Full Code Here


                int offset = scaledRandomIntBetween(0, buffer.length - 1);
                int read = stream.read(buffer, offset, buffer.length - offset);
                target.append(new BytesRef(buffer, offset, read));
            }
            assertEquals(data.length, target.length());
            assertArrayEquals(data, Arrays.copyOfRange(target.bytes(), 0, target.length()));
        }
        store.close();
    }

    protected BlobStore newBlobStore() {
View Full Code Here

                try (final InputStream stream = new PartSliceStream(blobContainer, fileInfo)) {
                    BytesRefBuilder builder = new BytesRefBuilder();
                    Store.MetadataSnapshot.hashFile(builder, stream, fileInfo.length());
                    BytesRef hash = fileInfo.metadata().hash(); // reset the file infos metadata hash
                    assert hash.length == 0;
                    hash.bytes = builder.bytes();
                    hash.offset = 0;
                    hash.length = builder.length();
                }
            }
        }
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.