flip encode buffer
This commit is contained in:
parent
ab5461d73e
commit
19c4939ede
|
@ -93,7 +93,21 @@ public class HpackEncoder
|
||||||
ByteBuffer buffer = lease.acquire(8*1024,false); // TODO make size configurable
|
ByteBuffer buffer = lease.acquire(8*1024,false); // TODO make size configurable
|
||||||
|
|
||||||
// TODO handle multiple buffers if large size configured.
|
// TODO handle multiple buffers if large size configured.
|
||||||
|
BufferUtil.clearToFill(buffer);
|
||||||
encode(buffer,metadata);
|
encode(buffer,metadata);
|
||||||
|
BufferUtil.flipToFlush(buffer,0);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void encodeMaxHeaderTableSize(ByteBuffer buffer, int maxHeaderTableSize)
|
||||||
|
{
|
||||||
|
// TODO
|
||||||
|
_context.resize(maxHeaderTableSize);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void encodeClearReferenceSet(ByteBuffer buffer)
|
||||||
|
{
|
||||||
|
// TODO
|
||||||
|
_context.clearReferenceSet();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void encode(ByteBuffer buffer, MetaData metadata)
|
public void encode(ByteBuffer buffer, MetaData metadata)
|
||||||
|
|
|
@ -52,7 +52,6 @@ public class HpackTest
|
||||||
BufferUtil.flipToFlush(buffer,0);
|
BufferUtil.flipToFlush(buffer,0);
|
||||||
Response decoded0 = (Response)decoder.decode(buffer);
|
Response decoded0 = (Response)decoder.decode(buffer);
|
||||||
|
|
||||||
System.err.println(decoded0);
|
|
||||||
Assert.assertEquals(original0,decoded0);
|
Assert.assertEquals(original0,decoded0);
|
||||||
|
|
||||||
// Same again?
|
// Same again?
|
||||||
|
@ -61,7 +60,6 @@ public class HpackTest
|
||||||
BufferUtil.flipToFlush(buffer,0);
|
BufferUtil.flipToFlush(buffer,0);
|
||||||
Response decoded0b = (Response)decoder.decode(buffer);
|
Response decoded0b = (Response)decoder.decode(buffer);
|
||||||
|
|
||||||
System.err.println(decoded0b);
|
|
||||||
Assert.assertEquals(original0,decoded0b);
|
Assert.assertEquals(original0,decoded0b);
|
||||||
|
|
||||||
|
|
||||||
|
@ -78,7 +76,6 @@ public class HpackTest
|
||||||
BufferUtil.flipToFlush(buffer,0);
|
BufferUtil.flipToFlush(buffer,0);
|
||||||
Response decoded1 = (Response)decoder.decode(buffer);
|
Response decoded1 = (Response)decoder.decode(buffer);
|
||||||
|
|
||||||
System.err.println(decoded1);
|
|
||||||
Assert.assertEquals(original1,decoded1);
|
Assert.assertEquals(original1,decoded1);
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue