bcdev / jpy

A bi-directional Python-Java bridge used to embed Java in CPython or the other way round.
Apache License 2.0
187 stars 37 forks source link

Java byte array has first 16 bytes incorrect when transformed with numpy.frombuffer in Python #191

Open ag-tcm opened 3 years ago

ag-tcm commented 3 years ago

When I pass a byte array (byte[]) as an argument to a Python function from the Java side and turn it into a numpy array, the result from np.frombuffer will have the first 16 bytes incorrect (and the other bytes are correct). But, this issue only occurs when the length of the array exceeds 392 byte.

See this SO question for more details.