Triton Mobile SDK for Android 3.5.1
This is a custom android player made by Triton Digital
Loading...
Searching...
No Matches
com.tritondigital.net.streaming.proxy.dataprovider.raw.RawPacket Class Reference
Inheritance diagram for com.tritondigital.net.streaming.proxy.dataprovider.raw.RawPacket:
com.tritondigital.net.streaming.proxy.dataprovider.Packet

Public Member Functions

void setPayload (byte[] payload, int payloadSize)
 Sets the payload to be wrapped in the packet.
 
byte[] getData ()
 Gets the packet raw data.
 
int getLength ()
 Gets the size of the entire packet (payload size + header size)
 
void setPayloadSize (int payloadSize)
 

Detailed Description

Represents the most simple form of a packet, no headers, simply a payload. To be optimal, the size of the payload needs to be known before creating the packet. Otherwise, the packet size is readjusted to be large enough for the payload.

This is typically used when receiving packets and transfering to the server without any modification.

Member Function Documentation

◆ getData()

byte[] com.tritondigital.net.streaming.proxy.dataprovider.raw.RawPacket.getData ( )

Gets the packet raw data.

Typically used to send the bytes to a socket after constructing it and setting the various header fields / payload.

Implements com.tritondigital.net.streaming.proxy.dataprovider.Packet.

◆ getLength()

int com.tritondigital.net.streaming.proxy.dataprovider.raw.RawPacket.getLength ( )

Gets the size of the entire packet (payload size + header size)

Implements com.tritondigital.net.streaming.proxy.dataprovider.Packet.

◆ setPayload()

void com.tritondigital.net.streaming.proxy.dataprovider.raw.RawPacket.setPayload ( byte[]  payload,
int  payloadSize 
)

Sets the payload to be wrapped in the packet.

Payload is copied after the header. To help reusing buffers, the size of the payload inside the bytes array is passed as a parameter. This allows passing a larger buffer (that would be reused for the generation of multiple packets). Only the good part of this bytes array is copied, not the entire bytes array.

◆ setPayloadSize()

void com.tritondigital.net.streaming.proxy.dataprovider.raw.RawPacket.setPayloadSize ( int  payloadSize)

Sets the payload size. If the current buffer is not large enough, it is reallocated and the header is copied to the new buffer.

No assumption can be made regarding the previous payload after a call to this method. It may still be present if no reallocation was necessary, and it may be lost if there was a reallocation (as only the header is copied). It is assumed that changing the size of the payload implicitly implies changing the payload itself.


The documentation for this class was generated from the following file: