@FunctionalInterface
public static interface Writeable.Writer<V>
StreamOutput
.
By convention this is a method from StreamOutput
itself (e.g., StreamOutput.writeString(java.lang.String)
). If the value can be
null
, then the "optional" variant of methods should be used!
Most classes should implement Writeable
and the Writeable.writeTo(StreamOutput)
method should use
StreamOutput
methods directly or this indirectly:
public void writeTo(StreamOutput out) throws IOException {
out.writeVInt(someValue);
out.writeMapOfLists(someMap, StreamOutput::writeString, StreamOutput::writeString);
}
Modifier and Type | Method and Description |
---|---|
void |
write(StreamOutput out,
V value)
Write
V -type value to the out put stream. |
void write(StreamOutput out, V value) throws java.io.IOException
V
-type value
to the out
put stream.out
- Output to write the value
toovalue
- The value to addjava.io.IOException