Code Monkey home page Code Monkey logo

scala-bencode's Introduction

scala-bencode

This is (yet another) bencode library for Scala. It's a bit more polished than most, and includes novel features such as documentation and tests, and the ability to serialise to bencode. Crazy, right?

Extensive usage documentation is in the scaladoc, but here's an example as a taster:

// read a torrent file into a BValue:
val torrent = BValue.read(Files.readAllBytes(torrentPath))
torrent match {
  case BDictionary(kvs) => ???
}

// serialise into a byte array:
val array = {
  val builder = Array.newBuilder[Byte]
  torrent.write(builder)
  builder.result
}

This library is not currently being published to e.g. Sonatype. You are instead encouraged to just cut-and-paste the code directory into your own project, ideally after changing the package namespace. Please drop me an email at [email protected] if you do that, so I can advise you of any major changes in the future which you may wish to incorporate into your own copy.

scala-bencode's People

Contributors

davidtimms avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.