Package org.elasticsearch.common.io.stream

Examples of org.elasticsearch.common.io.stream.ReleasableBytesStreamOutput.writeByte()


    private BytesReference getRandomizedPagedBytesReference(int length) {
        // we know bytes stream output always creates a paged bytes reference, we use it to create randomized content
        ReleasableBytesStreamOutput out = new ReleasableBytesStreamOutput(length, bigarrays);
        try {
            for (int i = 0; i < length; i++) {
                out.writeByte((byte) getRandom().nextInt(1 << 8));
            }
        } catch (IOException e) {
            fail("should not happen " + e.getMessage());
        }
        assertThat(out.size(), Matchers.equalTo(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.