C# Class PeterO.BEncoding

Contains methods for reading and writing objects represented in BEncode, a serialization format used in the BitTorrent protocol. For more information, see: http://wiki.theory.org/BitTorrentSpecification This class accepts BEncoded strings in UTF-8, and outputs BEncoded strings in UTF-8. This class also demonstrates how CBORObject supports predefined serialization formats.
Show file Open project: peteroupc/CBOR

Public Methods

Method Description
LongToString ( long longValue ) : string
Read ( Stream stream ) : CBORObject
Write ( CBORObject obj, Stream stream ) : void

Private Methods

Method Description
ReverseChars ( char chars, int offset, int length ) : void
readDictionary ( Stream stream ) : CBORObject
readInteger ( Stream stream ) : CBORObject
readList ( Stream stream ) : CBORObject
readObject ( Stream stream, bool allowEnd ) : CBORObject
readString ( Stream stream, char firstChar ) : CBORObject
writeUtf8 ( string s, Stream stream ) : void

Method Details

LongToString() public static method

public static LongToString ( long longValue ) : string
longValue long
return string

Read() public static method

public static Read ( Stream stream ) : CBORObject
stream Stream
return CBORObject

Write() public static method

public static Write ( CBORObject obj, Stream stream ) : void
obj CBORObject
stream Stream
return void