Examples of BytesStreamInput


Examples of org.elasticsearch.common.io.stream.BytesStreamInput

            BytesStreamOutput out = new BytesStreamOutput();
            MappingMetaData.writeTo(expected, out);
            out.close();
            BytesReference bytes = out.bytes();

            MappingMetaData metaData = MappingMetaData.readFrom(new BytesStreamInput(bytes));

            assertThat(metaData, is(expected));
        }

        // Testing "now" value for default timestamp
        {
            MappingMetaData.Timestamp timestamp = new MappingMetaData.Timestamp(true, null,
                    TimestampFieldMapper.DEFAULT_DATE_TIME_FORMAT, "now");
            MappingMetaData expected = new MappingMetaData("type", new CompressedString("{}".getBytes(UTF8)),
                    new MappingMetaData.Id(null), new MappingMetaData.Routing(false, null), timestamp, false);

            BytesStreamOutput out = new BytesStreamOutput();
            MappingMetaData.writeTo(expected, out);
            out.close();
            BytesReference bytes = out.bytes();

            MappingMetaData metaData = MappingMetaData.readFrom(new BytesStreamInput(bytes));

            assertThat(metaData, is(expected));
        }
    }
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.