Skip to content

v1.3

Compare
Choose a tag to compare
@dampcake dampcake released this 22 Jul 01:51

Fix for #6, thanks @zzyandzzy for filing.

New constructor argument for Bencode and BencodeInputStream a boolean called useBytes. This is especially useful when working with torrent files as not all of the byte strings can be converted to Strings without data loss.

If useBytes is true:

  • List and Map values (not keys in Maps) will not be coerced into a String value but instead be kept as binary data in a ByteBuffer.
  • ByteBuffer is now understood by the BencodeOutputStream and will be added as byte string data.
  • New methods added for writing/reading ByteBuffers added.

If useBytes is false:

  • List and Map values will continue to be coerced into Strings.