Skip to content

Latest commit

 

History

History
69 lines (40 loc) · 1.14 KB

api.md

File metadata and controls

69 lines (40 loc) · 1.14 KB

Bencodobi API

bencodobi

decode, encode

decode

function | source

(decode input &opt indicator)

Decode input

This function is possibly called by the list and dictionary decoding functions and so can be passed an initial indicator.

encode

function | source

(encode output val)

Encode val and write it to output

This function will throw an error if val is not a valid value for bencoding.

iostream

reader, writer

reader

function | source

(reader source)

Wrap source in an IOReader unless it is already wrapped

The IOReader prototype is a stream reading abstraction that allows objects to respond to a :read function call.

writer

function | source

(writer dest)

Wrap dest in an IOWriter unless it is already wrapped

The IOWriter prototype is a stream writing abstraction that allows objects to respond to a :write function call.