Buri
Bencode Library
The bencoding format is described in https://www.bittorrent.org/beps/bep_0003.html
Integration
kotlin {
sourceSets {
commonMain.dependencies {
...
implementation("io.github.remmerw:buri:0.0.7")
}
...
}
}
API
@Test
fun examplesList() {
value: List<BEObject> = listOf(
.bencode(), .bencode()
)
buffer = Buffer()
value.encodeBencodeTo(buffer)
list = (buffer.decodeBencode() BEList).toList()
assertEquals(value.size, list.size)
a = value.first() BEInteger
assertEquals(a.toInt(), )
b = value.last() BEString
assertContentEquals(b.toByteArray(), .encodeToByteArray())
}