@FunctionalInterface
public static interface Writeable.Reader<V>
StreamInput#readOptionalWriteable(Reader)
.
As most classes will implement this via a constructor (or a static method in the case of enumerations), it's something that should look like:
public MyClass(final StreamInput in) throws IOException {
this.someValue = in.readVInt();
this.someMap = in.readMapOfLists(StreamInput::readString, StreamInput::readString);
}
Modifier and Type | Method and Description |
---|---|
V |
read(StreamInput in)
Read
V -type value from a stream. |
V read(StreamInput in) throws java.io.IOException
V
-type value from a stream.in
- Input to read the value fromjava.io.IOException