Companion

object Companion

Functions

Link copied to clipboard
fun decode(buf: ByteArray, offset: Int = 0): UtpHeader?

Parse a UtpHeader from the first 20 bytes of buf starting at offset. Returns null when there aren't 20 bytes available or the type nibble is not a known UtpType. libtorrent's incoming_packet() likewise rejects buf.size() < sizeof(utp_header) and get_type() >= NUM_TYPES.