proprot/tst/com/amazonaws/proprot/ProxyProtocolTest.java [111:139]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        TlvRaw tlv = new TlvRaw();
        tlv.setType(0xF0);
        tlv.setValue(new byte[] {1, 2, 3, 4, 5, 6, 7, 8});
        header.addTlv(tlv);

        // write
        ProxyProtocol protocol = new ProxyProtocol();
        ByteArrayOutputStream out = new ByteArrayOutputStream();
        protocol.write(header, out);

        // read
        ByteArrayInputStream in = new ByteArrayInputStream(out.toByteArray());
        Header header2 = protocol.read(in);

        // validate
        assertEquals(header.getCommand(), header2.getCommand());
        assertEquals(header.getAddressFamily(), header2.getAddressFamily());
        assertEquals(header.getTransportProtocol(), header2.getTransportProtocol());
        assertArrayEquals(header.getSrcAddress(), header2.getSrcAddress());
        assertArrayEquals(header.getDstAddress(), header2.getDstAddress());
        assertEquals(header.getSrcPort(), header2.getSrcPort());
        assertEquals(header.getDstPort(), header2.getDstPort());

        TlvRaw tlv2 = (TlvRaw) Iterables.getOnlyElement(header2.getTlvs());
        assertEquals(tlv.getType(), tlv2.getType());
        assertArrayEquals(tlv.getValue(), tlv2.getValue());
    }

    @Test
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



proprot/tst/com/amazonaws/proprot/ProxyProtocolTest.java [148:176]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        TlvRaw tlv = new TlvRaw();
        tlv.setType(0xF0);
        tlv.setValue(new byte[] {1, 2, 3, 4, 5, 6, 7, 8});
        header.addTlv(tlv);

        // write
        ProxyProtocol protocol = new ProxyProtocol();
        ByteArrayOutputStream out = new ByteArrayOutputStream();
        protocol.write(header, out);

        // read
        ByteArrayInputStream in = new ByteArrayInputStream(out.toByteArray());
        Header header2 = protocol.read(in);

        // validate
        assertEquals(header.getCommand(), header2.getCommand());
        assertEquals(header.getAddressFamily(), header2.getAddressFamily());
        assertEquals(header.getTransportProtocol(), header2.getTransportProtocol());
        assertArrayEquals(header.getSrcAddress(), header2.getSrcAddress());
        assertArrayEquals(header.getDstAddress(), header2.getDstAddress());
        assertEquals(header.getSrcPort(), header2.getSrcPort());
        assertEquals(header.getDstPort(), header2.getDstPort());

        TlvRaw tlv2 = (TlvRaw) Iterables.getOnlyElement(header2.getTlvs());
        assertEquals(tlv.getType(), tlv2.getType());
        assertArrayEquals(tlv.getValue(), tlv2.getValue());
    }

    @Test
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



