Package org.jgrapes.io.util
Interface InputConsumer
- All Known Implementing Classes:
JsonReader,LineCollector,ManagedBufferReader,ManagedBufferStreamer,WwwFormUrldecoder
public interface InputConsumer
May be implemented by classes that can consume input events to support
generic usage.
- Since:
- 2.8.0
-
Method Summary
Modifier and TypeMethodDescriptiondefault <W extends Buffer>
voidCallsfeed(ManagedBuffer)with the provided event’s buffer.<W extends Buffer>
voidfeed(ManagedBuffer<W> buffer) Feed data to the consumer.
-
Method Details
-
feed
Feed data to the consumer.The call blocks while data from a previous invocation has not been fully read. The buffer passed as argument is locked (see
ManagedBuffer.lockBuffer()) until all data has been consumed.Calling this method with
nullindicates the end of the feed.- Parameters:
buffer- the buffer
-
feed
Callsfeed(ManagedBuffer)with the provided event’s buffer.Calling this method with
nullindicates the end of the feed.- Parameters:
event- the event
-