@Test public void testPayload() { ByteBuffer buffer = createMockPacket(); IPv4Packet packet = new IPv4Packet(buffer); ByteBuffer payload = packet.getPayload(); Assert.assertEquals(0x11223344, payload.getInt(0)); }
public ByteBuffer getPayload() { int headersLength = ipv4Header.getHeaderLength() + transportHeader.getHeaderLength(); raw.position(headersLength); return raw.slice(); }
IPv4Packet { public ByteBuffer getPayload() { int headersLength = ipv4Header.getHeaderLength() + transportHeader.getHeaderLength(); raw.position(headersLength); return raw.slice(); } }
IPv4Packet { public ByteBuffer getPayload() { int headersLength = ipv4Header.getHeaderLength() + transportHeader.getHeaderLength(); raw.position(headersLength); return raw.slice(); } IPv4Packet(ByteBuffer raw); }
IPv4Packet { public ByteBuffer getPayload() { int headersLength = ipv4Header.getHeaderLength() + transportHeader.getHeaderLength(); raw.position(headersLength); return raw.slice(); } IPv4Packet(ByteBuffer raw); boolean isValid(); IPv4Header getIpv4Header(); TransportHeader getTransportHeader(); void swapSourceAndDestination(); ByteBuffer getRaw(); int getRawLength(); ByteBuffer getPayload(); int getPayloadLength(); void computeChecksums(); }
IPv4Packet { public ByteBuffer getPayload() { int headersLength = ipv4Header.getHeaderLength() + transportHeader.getHeaderLength(); raw.position(headersLength); return raw.slice(); } IPv4Packet(ByteBuffer raw); boolean isValid(); IPv4Header getIpv4Header(); TransportHeader getTransportHeader(); void swapSourceAndDestination(); ByteBuffer getRaw(); int getRawLength(); ByteBuffer getPayload(); int getPayloadLength(); void computeChecksums(); @SuppressWarnings("checkstyle:MagicNumber")
    static final int MAX_PACKET_LENGTH; }