Skip to content

List<Integer> RuntimeError: Unknown OpCode in the stream: 0x0 (at offset 0x8C) #5

@skotep

Description

@skotep

In Java I create an ArrayList of two Integers, e.g.,

List<Integer> data = new ArrayList<>();
data.add(1)
data.add(2)

which serializes to

b'\xac\xed\x00\x05sr\x00\x13java.util.ArrayListx\x81\xd2\x1d\x99\xc7a\x9d\x03\x00\x01I\x00\x04sizexp\x00\x00\x00\x02w\x04\x00\x00\x00\x02sr\x00\x11java.lang.Integer\x12\xe2\xa0\xa4\xf7\x81\x878\x02\x00\x01I\x00\x05valuexr\x00\x10java.lang.Number\x86\xac\x95\x1d\x0b\x94\xe0\x8b\x02\x00\x00xp\x00\x00\x00\x01sq\x00~\x00\x02\x00\x00\x00\x02x'

javaobj.loads(bytes)

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "javaobj.py", line 190, in loads
    ignore_remaining_data=ignore_remaining_data)
  File "javaobj.py", line 171, in load
    return marshaller.readObject(ignore_remaining_data=ignore_remaining_data)
  File "javaobj.py", line 501, in readObject
    _, res = self._read_and_exec_opcode(ident=0)
  File "javaobj.py", line 568, in _read_and_exec_opcode
    return opid, handler(ident=ident)
  File "javaobj.py", line 833, in do_object
    opcode, obj = self._read_and_exec_opcode(ident=ident + 1)
  File "javaobj.py", line 564, in _read_and_exec_opcode
    .format(opid, position))
RuntimeError: Unknown OpCode in the stream: 0x0 (at offset 0x8C)

If I only have one integer in the list then it loads fine. I have the problem with Doubles as well as Integers. Strings seem to work fine though.

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