A container for DATA frames metadata and content bytes.
Specialized subclasses (like {@link StringDataInfo}) may be used by applications to send specific types of content.
Applications may send multiple instances of {@link DataInfo}, usually of the same type, via {@link Stream#data(DataInfo)}. The last instance must have the {@link #isClose() close flag} set, so that the client knows that no more content isexpected.
Receivers of {@link DataInfo} via {@link StreamFrameListener#onData(Stream,DataInfo)}have two different APIs to read the data content bytes: a {@link #readInto(ByteBuffer) read}API that does not interact with flow control, and a {@link #consumeInto(ByteBuffer) drain}API that interacts with flow control.
Flow control is defined so that when the sender wants to sends a number of bytes larger than the {@link Settings.ID#INITIAL_WINDOW_SIZE} value, it will stop sending as soon as ithas sent a number of bytes equal to the window size. The receiver has to consume the data bytes that it received in order to tell the sender to send more bytes.
Consuming the data bytes can be done only via {@link #consumeInto(ByteBuffer)} or by a combinationof {@link #readInto(ByteBuffer)} and {@link #consume(int)} (possibly at different times).
|
|
|
|
|
|