ByteBuffer writeBuffer = generator.control(new SynReplyFrame(SPDY.V2, (byte)0, streamId, new Fields()));
channel.write(writeBuffer);
Assert.assertThat(writeBuffer.hasRemaining(), is(false));
byte[] bytes = new byte[1];
writeBuffer = generator.data(streamId, bytes.length, new BytesDataInfo(bytes, true));
channel.write(writeBuffer);
Assert.assertThat(writeBuffer.hasRemaining(), is(false));
// Write again to simulate the faulty condition
writeBuffer.flip();