Well, it tries to read buffer length before `WriteBuffer()` call, would be much better if it'll fail in assert.