Skip to content

Cannot read nested array in bencode #13

@Kineolyan

Description

@Kineolyan

From a bencode input "li1ei2el3:stree", I get [1 2 [#object["[B" 0x5351baec "[B@5351baec"]]]
Note: the input was created using write-bencode and seems correct with respect to the spec

Reproducing code:

(ns b
  (:require [bencode.core :as b]))

(defn bread
  [content]
  (-> (.getBytes content "UTF-8")
      java.io.ByteArrayInputStream.
      java.io.PushbackInputStream.
      b/read-bencode))

(bread "li1ei2el3:stree")

I am using version from babashka 0.6.4, so I guess this is the latest.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions