Skip to content

Commit 1d991f8

Browse files
committed
Support Netty ByteBuf variable sized data (#183)
1 parent 3d95bf1 commit 1d991f8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/main/java/org/lmdbjava/ByteBufProxy.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ protected ByteBuf out(final ByteBuf buffer, final Pointer ptr,
147147
final long size = UNSAFE.getLong(ptrAddr + STRUCT_FIELD_OFFSET_SIZE);
148148
UNSAFE.putLong(buffer, addressOffset, addr);
149149
UNSAFE.putInt(buffer, lengthOffset, (int) size);
150-
buffer.writerIndex((int) size).readerIndex(0);
150+
buffer.clear().writerIndex((int) size);
151151
return buffer;
152152
}
153153
}

0 commit comments

Comments
 (0)