Skip to content

ArgumentError with BERT::Decode.new #7

@artob

Description

@artob

Running into a bit of a perplexing problem with version 1.1.2:

>> BERT::Decode.new(StringIO.new("\203h\002d\000\005replyl\000\000\000\001a\001j"))
ArgumentError: wrong number of arguments (1 for 0)
    from (irb):2:in `initialize'
    from (irb):2:in `new'

I don't immediately see how that error's even possible given the code for BERT::Decode#initialize. Maybe there's a redefinition of the new class method going on elsewhere - didn't look.

The following works as expected:

>> BERT::Decode.decode("\203h\002d\000\005replyl\000\000\000\001a\001j")
=> t[:reply, [1]]

However, I'd prefer to be able to use BERT::Decode.new directly with an IO object, to avoid the StringIO creation overhead inside BERT::Decode.decode; important for decoding larger messages that can be read block by block, on demand, instead of copied around in full in memory a couple of times over.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions