code: @Override
      public UDPPacket frame(final IPPacket parent, final Buffer buffer) throws IOException {
          if (parent == null) {
              throw new IllegalArgumentException("The parent frame cannot be null");
          }
  
          // UDP header is very simple. For our purposes, just
          // read the 8 bytes containing all the header fields
          // and the rest is just user data (payload of the udp packet)
          final Buffer headers = buffer.readBytes(8);
          final Buffer payload = buffer.slice();
          if (payload.isEmpty()) {
              return new UdpPacketImpl(parent, headers, null);
          }
          return new UdpPacketImpl(parent, headers, payload);
      }
docs: {@inheritDoc}