Failed to deserialise Byte object from byte with value greater than 128

Issue #474 resolved
Олег Мороз created an issue

When i’m trying to deserialize object which contains list of bytes from array like [0xff,0xfe] i've got NumberFormatException on this line:

https://bitbucket.org/asomov/snakeyaml/src/3d49667ece57d564668b9a155c55ccfe26aaca00/src/main/java/org/yaml/snakeyaml/constructor/Constructor.java#lines-480

have change it to to fix a problem:

result = Integer.valueOf(result.toString()).byteValue();

Comments (5)

  1. Andrey Somov

    Can you please provide a (failing) test ? I do not what is the issue here. Byte in Java may not be bigger then 127.

  2. Олег Мороз reporter
        Yaml yamlProcessor = new Yaml();
        Byte[] lb = yamlProcessor.loadAs("[0x01,0x02,0xff]", Byte[].class);
    

  3. Log in to comment