Class BytesRefStreamOutput

java.lang.Object
java.io.OutputStream
org.elasticsearch.common.io.stream.StreamOutput
org.elasticsearch.common.io.stream.BytesRefStreamOutput
All Implemented Interfaces:
Closeable, Flushable, AutoCloseable, org.apache.lucene.util.Accountable

public class BytesRefStreamOutput extends StreamOutput implements org.apache.lucene.util.Accountable
A @link StreamOutput that is backed by a BytesRef. This is useful for small data, for larger or unknown sizes use BytesStreamOutput instead. Compared to BytesStreamOutput this class avoids copying the bytes ref. Compared to BytesRefBuilder this class supports writing all the rich data types that StreamOutput supports.