Skip to content

v3.0.0

Compare
Choose a tag to compare
@Krusen Krusen released this 13 Oct 14:52
· 43 commits to master since this release

here is a few changes to the public API, but most people shouldn't be affected by this unless they have extended/overriden functionality.
Basic usage should not see any or only minor changes compared to v2.3.0.

Implemented async support for parsing/encoding.

Added build targets for .NET Core 2.1 and .NET Core 3.0 to take advantage of performance improvements
in Stream and Encoding APIs for .NET Core 2.1 or later.

Rewrite of internal parsing for better performance, taking advantage of new Span<T>/Memory<T>
types - faster parsing and less memory allocation.

Removed support for .NET Framework 4.5 and .NET Standard 1.3.
Lowest supported versions are now .NET Framework 4.6.1 (4.7.2 highly recommended) and .NET Standard 2.0.

Added

  • Implemented parsing/encoding using PipeReader/PipeWriter
  • Added BencodeReader as replacement for BencodeStream
  • Added IBObject.GetSizeInBytes() method, returning the size of the object in number of bytes.

Changed

  • Improved parsing/encoding performance
  • Reduced memory allocation on parsing/encoding
  • Made BString, BNumber, BList and BDictionary classes sealed
  • Made parse methods of BencodeParser virtual so it can be overriden if needed by anyone
  • Constructor BString(IEnumerable<byte> bytes, Encoding encoding = null) changed to BString(byte[] bytes, Encoding encoding = null)
  • Exposed value type of BString changed from IReadOnlyList<byte> (byte[] internally) to ReadOnlyMemory<byte>
  • Removed parse method overloads on IBencodeParser and added matching extension methods instead
  • Removed encode method overloads on IBObject and added matching extension methods instead
  • Torrent parse mode now default to TorrentParserMode.Tolerant instead of TorrentParserMode.Strict
  • Torrent related classes moved to BencodeNET.Torrents namespace

Removed

  • Removed BencodeStream and replaced with BencodeReader
  • Dropped .NET Standard 1.3 support; .NET Standard 2.0 is now lowest supported version
  • Dropped .NET Framework 4.5 support; .NET Framework 4.6.1 is now lowest supported version (but 4.7.2 is highly recommended)
  • Removed most constructors on BencodeParser leaving only BencodeParser(Encoding encoding = null) and
    added BencodeParser.Encoding property to enable changing encoding. Parsers can still be added/replaced/removed
    through BencodeParser.Parsers property.

Fixed

  • Parsing from non-seekable Streams is now possible
  • Fixed issue parsing torrent files with non-standard 'announce-list' (#39)