io.agora.rtc

## Class AgoraMediaPacketSender

- java.lang.Object
- - io.agora.rtc.AgoraMediaPacketSender

-     public class AgoraMediaPacketSender
      extends java.lang.Object

  Wrapper for sending media packets.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `private long` | `cptr` Native pointer to the packet sender instance.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `AgoraMediaPacketSender(long cptr)` Constructs a media packet sender.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `destroy()` Destroys the packet sender and releases native resources.
    `private void` | `ndestroy()` Destroys the native packet sender.
    `int` | `send(byte[] packet, int length, PacketOptions options)` Sends a media packet.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### cptr

          private long cptr

      Native pointer to the packet sender instance.

  - ### Constructor Detail

    - #### AgoraMediaPacketSender

          public AgoraMediaPacketSender(long cptr)

      Constructs a media packet sender.
      Parameters:
        `cptr` - Native pointer to the sender instance

  - ### Method Detail

    - #### send

          public int send(byte[] packet,
                          int length,
                          PacketOptions options)

      Sends a media packet.
      Parameters:
        `packet` - Packet data to send
        `length` - Length of the packet data
        `options` - Packet sending options
      Returns:
        0 on success, <0 on failure

    - #### ndestroy

          private void ndestroy()

      Destroys the native packet sender.

    - #### destroy

          public void destroy()

      Destroys the packet sender and releases native resources.