apache / datasketches-memory

High performance native memory access for Java.
https://datasketches.apache.org
Apache License 2.0
118 stars 27 forks source link

Reported in issue #178: #181

Closed leerho closed 4 months ago

leerho commented 4 months ago

static Memory wrap(byte[] array, int offsetBytes, int lengthBytes, ByteOrder byteOrder) ... ... return BaseWritableMemoryImpl.wrapHeapArray(array, 0, lengthBytes, true, ByteOrder.nativeOrder(), null);

The "0" in the return statement should have been "offsetBytes". I checked the similar classes WritableMemory, Buffer and WritableBuffer for a similar error and they were all OK. This fix includes a test for this bug.

This will be merged into branch 2.2.X in preparation for a bug fix release 2.2.1.