Ejemplo n.º 1
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldDecodeFullChunk()
        public virtual void ShouldDecodeFullChunk()
        {
            // whole chunk with header and body arrives at once
            ByteBuf input = buffer();

            input.writeShort(7);
            input.writeByte(1);
            input.writeByte(11);
            input.writeByte(2);
            input.writeByte(22);
            input.writeByte(3);
            input.writeByte(33);
            input.writeByte(4);

            // after buffer is written there should be something to read on the other side
            assertTrue(_channel.writeInbound(input));
            assertTrue(_channel.finish());

            // there should only be a single chunk available for reading
            assertEquals(1, _channel.inboundMessages().size());
            // it should have no size header and expected body
            assertByteBufEquals(input.slice(2, 7), _channel.readInbound());
        }