Skip to content

Commit 6a2fbb9

Browse files
authored
Patch to support serialization of JavaByteArrays
1 parent 07ca2a0 commit 6a2fbb9

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

javaobj.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -368,6 +368,16 @@ def __iter__(self):
368368
def __len__(self):
369369
return len(self._data)
370370

371+
class ByteArrayDesc(object):
372+
373+
def __init__(self):
374+
self.name='[B'
375+
self.serialVersionUID=-5984413125824719648
376+
self.fields_names=[]
377+
self.fields_types=[]
378+
self.flags = 0x2
379+
self.superclass=None
380+
371381
# ------------------------------------------------------------------------------
372382

373383

@@ -1199,7 +1209,7 @@ def writeObject(self, obj):
11991209
:raise RuntimeError: Unsupported type
12001210
"""
12011211
log_debug("Writing object of type {0}".format(type(obj).__name__))
1202-
if isinstance(obj, JavaArray):
1212+
if isinstance(obj, (JavaArray, JavaByteArray)):
12031213
# Deserialized Java array
12041214
self.write_array(obj)
12051215
elif isinstance(obj, JavaEnum):

0 commit comments

Comments
 (0)