package org.glassfish.grizzly.http2;
import org.glassfish.grizzly.Buffer;
import org.glassfish.grizzly.http2.frames.HeaderBlockHead;
import org.glassfish.grizzly.http2.hpack.Decoder;
import org.glassfish.grizzly.http2.hpack.DecodingCallback;
import org.glassfish.grizzly.memory.Buffers;
import org.glassfish.grizzly.memory.MemoryManager;
public class {
private final Decoder ;
private final MemoryManager ;
private final int ;
private int ;
private HeaderBlockHead ;
private Buffer ;
public (final MemoryManager memoryManager,
final int maxHeaderSize,
final int maxHeaderTableSize) {
this.memoryManager = memoryManager;
this.maxHeaderSize = maxHeaderSize;
this.hpackDecoder = new Decoder(maxHeaderTableSize);
}
public boolean (final Buffer buffer) {
currentHeaderSize += buffer.remaining();
if (currentHeaderSize <= maxHeaderSize) {
inBuffer = Buffers.appendBuffers(memoryManager, inBuffer, buffer, true);
return true;
}
return false;
}
public void (final DecodingCallback callback) {
if (inBuffer != null) {
hpackDecoder.decode(inBuffer, !isProcessingHeaders(), callback);
inBuffer.tryDispose();
inBuffer = null;
}
}
public HeaderBlockHead () {
final HeaderBlockHead firstHeaderFrameLocal = firstHeaderFrame;
firstHeaderFrame = null;
currentHeaderSize = 0;
return firstHeaderFrameLocal;
}
public void (
final HeaderBlockHead firstHeaderFrame) {
this.firstHeaderFrame = firstHeaderFrame;
}
public boolean () {
return firstHeaderFrame != null;
}
}