Skip to content

Commit 738c836

Browse files
committed
docs: Add guide to README
1 parent 4da4b59 commit 738c836

File tree

1 file changed

+14
-5
lines changed

1 file changed

+14
-5
lines changed

README.md

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,26 @@
11
# kotlinx-serialization-bencode
22

3-
A Kotlin serialization codec used to encode/decode bencoding format.
3+
A Kotlin serialization codec for bencoding format. (Bittorrent)
44

5-
🚧WIP: Currently only decoder is implemented.🚧
5+
🚧Note: Currently only decoder was implemented.🚧
66

77
Reference: [https://www.bittorrent.org/beps/bep_0003.html](https://www.bittorrent.org/beps/bep_0003.html)
88

99
## Usage
10+
11+
Add the dependency to your `build.gradle.kts`
12+
```kotlin
13+
dependencies{
14+
implementation("space.iseki.bencoding:kotlinx-serialization-bencoding:0.1.0")
15+
}
16+
```
17+
1018
```kotlin
1119
@Serialization
12-
data class Meta(val announce: String)
20+
data class Meta(val announce: String) // The torrent file format
1321

14-
fun foo(input: InputStream){
15-
println(input.decodeBencode<Meta>())
22+
fun foo(input: InputStream) {
23+
println(input.decodeInBencoding<Meta>())
1624
}
1725
```
26+

0 commit comments

Comments
 (0)