code: public void wrap(boolean mark, int payloadType, int seqNumber, long timestamp, long ssrc, byte[] data, int offset, int len) {
          buffer.clear();
          buffer.rewind();
  
          //no extensions, paddings and cc
          buffer.put((byte)0x80);
  
          byte b = (byte) (payloadType);
          if (mark) {
              b = (byte) (b | 0x80);
          }
  
          buffer.put(b);
  
          //sequence number
           buffer.put((byte) ((seqNumber & 0xFF00) >> 8));
           buffer.put((byte) (seqNumber & 0x00FF));
  
           //timestamp
           buffer.put((byte) ((timestamp & 0xFF000000) >> 24));
           buffer.put((byte) ((timestamp & 0x00FF0000) >> 16));
           buffer.put((byte) ((timestamp & 0x0000FF00) >> 8));
           buffer.put((byte) ((timestamp & 0x000000FF)));
  
           //ssrc
           buffer.put((byte) ((ssrc & 0xFF000000) >> 24));
           buffer.put((byte) ((ssrc & 0x00FF0000) >> 16));
           buffer.put((byte) ((ssrc & 0x0000FF00) >> 8));
           buffer.put((byte) ((ssrc & 0x000000FF)));
  
           buffer.put(data, offset, len);
           buffer.flip();
           buffer.rewind();
      }
docs: Encapsulates data into the packet for transmission via RTP.
  
  @param mark mark field
  @param payloadType payload type field.
  @param seqNumber sequence number field
  @param timestamp timestamp field
  @param ssrc synchronization source field
  @param data data buffer
  @param offset offset in the data buffer
  @param len the number of bytes