Message

data class Message(val type: UtMetadata.Type, val piece: Int, val totalSize: Long = 0, val data: ByteArray = EMPTY)

A decoded ut_metadata message.

Constructors

Link copied to clipboard
constructor(type: UtMetadata.Type, piece: Int, totalSize: Long = 0, data: ByteArray = EMPTY)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

for a Type.DATA message, the raw piece bytes that followed the bencode dict; an empty array otherwise.

Link copied to clipboard
val piece: Int

the 0-based 16 KiB piece index.

Link copied to clipboard

for a Type.DATA message, the total metadata length the sender advertises; 0 / meaningless for request and reject. libtorrent reads it with dict_find_int_value("total_size", 0).

Link copied to clipboard

the Type (request / data / reject).

Functions

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard
open override fun hashCode(): Int
Link copied to clipboard
open override fun toString(): String