Interface Writeable.Reader<V>
- All Known Subinterfaces:
TransportResponseHandler<T>
- All Known Implementing Classes:
ActionListenerResponseHandler
,EmptyTransportResponseHandler
,FutureTransportResponseHandler
,PlainTransportFuture
,TransportResponseHandler.Empty
,TransportService.ContextRestoreResponseHandler
- Enclosing interface:
- Writeable
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
Reference to a method that can read some object from a stream. By convention this is a constructor that takes
StreamInput as an argument for most classes and a static method for things like enums. Returning null from one of these
is always wrong - for that we use methods like
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);
}
-
Method Summary
-
Method Details
-
read
ReadV
-type value from a stream.- Parameters:
in
- Input to read the value from- Throws:
IOException
-