@Override
    @SuppressWarnings("MagicNumber")
    public void clear() {
        pos = 0;
        if (buffer != null && buffer.length > initialSize * 8) {
            buffer = new byte[initialSize * 8];
        }
        version = UNKNOWN;
        wanProtocolVersion = UNKNOWN;
    }
@Test
    public void testClear() {
        out.clear();
        assertEquals(0, out.position());
        assertEquals(10, out.available());
    }